summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-05-02 15:57:31 (GMT)
committerSwift Review <review@swift.im>2014-05-26 19:33:36 (GMT)
commitbf3739c75fcb312a99608488c8741e2ffc15ca1e (patch)
tree0eb8697735f82bc33e2e8e59770f7ecfe4bbc8ac /Swift/Controllers/Chat
parentd9bd353dc90008bd8d723630ec9c037a3c1f5ad2 (diff)
downloadswift-bf3739c75fcb312a99608488c8741e2ffc15ca1e.zip
swift-bf3739c75fcb312a99608488c8741e2ffc15ca1e.tar.bz2
Allow bookmarking of MUCs from cog menu.
Change-Id: I55f696c98598ec9bfd1ac13a2abd3c1ee2b1e9fa
Diffstat (limited to 'Swift/Controllers/Chat')
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp9
-rw-r--r--Swift/Controllers/Chat/MUCController.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index df99368..cb2616c 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -93,6 +93,7 @@ MUCController::MUCController (
chatWindow_->onOccupantSelectionChanged.connect(boost::bind(&MUCController::handleWindowOccupantSelectionChanged, this, _1));
chatWindow_->onOccupantActionSelected.connect(boost::bind(&MUCController::handleActionRequestedOnOccupant, this, _1, _2));
chatWindow_->onChangeSubjectRequest.connect(boost::bind(&MUCController::handleChangeSubjectRequest, this, _1));
+ chatWindow_->onBookmarkRequest.connect(boost::bind(&MUCController::handleBookmarkRequest, this));
chatWindow_->onConfigureRequest.connect(boost::bind(&MUCController::handleConfigureRequest, this, _1));
chatWindow_->onConfigurationFormCancelled.connect(boost::bind(&MUCController::handleConfigurationCancelled, this));
chatWindow_->onDestroyRequest.connect(boost::bind(&MUCController::handleDestroyRoomRequest, this));
@@ -799,6 +800,14 @@ void MUCController::handleChangeSubjectRequest(const std::string& subject) {
muc_->changeSubject(subject);
}
+void MUCController::handleBookmarkRequest() {
+ const JID jid = muc_->getJID();
+ MUCBookmark bookmark(jid, jid.toBare().toString());
+ bookmark.setPassword(password_);
+ bookmark.setNick(nick_);
+ chatWindow_->showBookmarkWindow(bookmark);
+}
+
void MUCController::handleConfigureRequest(Form::ref form) {
if (form) {
muc_->configureRoom(form);
diff --git a/Swift/Controllers/Chat/MUCController.h b/Swift/Controllers/Chat/MUCController.h
index 317f579..e78ff77 100644
--- a/Swift/Controllers/Chat/MUCController.h
+++ b/Swift/Controllers/Chat/MUCController.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2013 Kevin Smith
+ * Copyright (c) 2010-2014 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
@@ -93,6 +93,7 @@ namespace Swift {
void handleJoinFailed(boost::shared_ptr<ErrorPayload> error);
void handleJoinTimeoutTick();
void handleChangeSubjectRequest(const std::string&);
+ void handleBookmarkRequest();
std::string roleToGroupName(MUCOccupant::Role role);
std::string roleToSortName(MUCOccupant::Role role);
JID nickToJID(const std::string& nick);