summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp9
-rw-r--r--Swift/Controllers/Chat/MUCController.h3
-rw-r--r--Swift/Controllers/UIInterfaces/ChatWindow.h5
-rw-r--r--Swift/Controllers/UnitTest/MockChatWindow.h3
4 files changed, 17 insertions, 3 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
@@ -95,2 +95,3 @@ MUCController::MUCController (
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));
@@ -801,2 +802,10 @@ void MUCController::handleChangeSubjectRequest(const std::string& 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) {
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,3 +1,3 @@
/*
- * Copyright (c) 2010-2013 Kevin Smith
+ * Copyright (c) 2010-2014 Kevin Smith
* Licensed under the GNU General Public License v3.
@@ -95,2 +95,3 @@ namespace Swift {
void handleChangeSubjectRequest(const std::string&);
+ void handleBookmarkRequest();
std::string roleToGroupName(MUCOccupant::Role role);
diff --git a/Swift/Controllers/UIInterfaces/ChatWindow.h b/Swift/Controllers/UIInterfaces/ChatWindow.h
index 771872a..096a59a 100644
--- a/Swift/Controllers/UIInterfaces/ChatWindow.h
+++ b/Swift/Controllers/UIInterfaces/ChatWindow.h
@@ -1,3 +1,3 @@
/*
- * Copyright (c) 2010-2012 Kevin Smith
+ * Copyright (c) 2010-2014 Kevin Smith
* Licensed under the GNU General Public License v3.
@@ -21,2 +21,3 @@
#include <Swiften/Elements/MUCOccupant.h>
+#include <Swiften/MUC/MUCBookmark.h>
#include <Swift/Controllers/HighlightManager.h>
@@ -150,2 +151,3 @@ namespace Swift {
virtual void setCanInitiateImpromptuChats(bool supportsImpromptu) = 0;
+ virtual void showBookmarkWindow(const MUCBookmark& bookmark) = 0;
/**
@@ -182,2 +184,3 @@ namespace Swift {
boost::signal<void (const std::string&)> onChangeSubjectRequest;
+ boost::signal<void ()> onBookmarkRequest;
boost::signal<void (Form::ref)> onConfigureRequest;
diff --git a/Swift/Controllers/UnitTest/MockChatWindow.h b/Swift/Controllers/UnitTest/MockChatWindow.h
index 8aa645d..c2e2c9f 100644
--- a/Swift/Controllers/UnitTest/MockChatWindow.h
+++ b/Swift/Controllers/UnitTest/MockChatWindow.h
@@ -1,3 +1,3 @@
/*
- * Copyright (c) 2010 Kevin Smith
+ * Copyright (c) 2010-2014 Kevin Smith
* Licensed under the GNU General Public License v3.
@@ -73,2 +73,3 @@ namespace Swift {
virtual void setCanInitiateImpromptuChats(bool /*supportsImpromptu*/) {}
+ virtual void showBookmarkWindow(const MUCBookmark& /*bookmark*/) {}