summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/Controllers/Chat/MUCController.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp
index c9936c0..35e79cc 100644
--- a/Swift/Controllers/Chat/MUCController.cpp
+++ b/Swift/Controllers/Chat/MUCController.cpp
@@ -926,14 +926,26 @@ void MUCController::handleChangeSubjectRequest(const std::string& subject) {
926 muc_->changeSubject(subject); 926 muc_->changeSubject(subject);
927} 927}
928 928
929void MUCController::handleBookmarkRequest() { 929void MUCController::handleBookmarkRequest() {
930 const JID jid = muc_->getJID(); 930 const JID jid = muc_->getJID();
931 MUCBookmark bookmark(jid, jid.toBare().toString()); 931
932 bookmark.setPassword(password_); 932 // Prepare new bookmark for this room.
933 bookmark.setNick(nick_); 933 MUCBookmark roomBookmark(jid, jid.toBare().toString());
934 chatWindow_->showBookmarkWindow(bookmark); 934 roomBookmark.setPassword(password_);
935 roomBookmark.setNick(nick_);
936
937 // Check for existing bookmark for this room and, if it exists, use it instead.
938 std::vector<MUCBookmark> bookmarks = mucBookmarkManager_->getBookmarks();
939 foreach (const MUCBookmark& bookmark, bookmarks) {
940 if (bookmark.getRoom() == jid.toBare()) {
941 roomBookmark = bookmark;
942 break;
943 }
944 }
945
946 chatWindow_->showBookmarkWindow(roomBookmark);
935} 947}
936 948
937void MUCController::handleConfigureRequest(Form::ref form) { 949void MUCController::handleConfigureRequest(Form::ref form) {
938 if (form) { 950 if (form) {
939 muc_->configureRoom(form); 951 muc_->configureRoom(form);