diff options
author | Tobias Markmann <tm@ayena.de> | 2016-01-12 17:23:05 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2016-02-02 11:33:06 (GMT) |
commit | 1b9ccc1fef6104eaf951153ddccdc6bb15899e9a (patch) | |
tree | 428232448e9846265605820db6f380a5b98c018a /Swift/Controllers/Chat/ChatsManager.cpp | |
parent | 3afd061b713ce5fff604dee62dec8410a1de6a9c (diff) | |
download | swift-1b9ccc1fef6104eaf951153ddccdc6bb15899e9a.zip swift-1b9ccc1fef6104eaf951153ddccdc6bb15899e9a.tar.bz2 |
Change stanza body to boost::optional<std::string> type
Changed MUCController to only handle message stanzas as
subject change if <subject/> is present and neither <body/>
nor <thread/> is present in the message stanza.
Test-Information:
Added unit tests verifying behavior described in XEP-0045
section 8.1.
Unit tests pass on OS X 10.11.2.
Change-Id: I1d22272da1675176be131ab360b214a98f20533f
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.cpp')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 1a69982..49caee4 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -890,61 +890,61 @@ void ChatsManager::handleIncomingMessage(boost::shared_ptr<Message> message) { return; } } // check for impromptu invite to potentially auto-accept MUCInvitationPayload::ref invite = message->getPayload<MUCInvitationPayload>(); if (invite && autoAcceptMUCInviteDecider_->isAutoAcceptedInvite(message->getFrom(), invite)) { if (invite->getIsContinuation()) { // check for existing chat controller for the from JID ChatController* controller = getChatControllerIfExists(jid); if (controller) { ChatWindow* window = controller->detachChatWindow(); chatControllers_.erase(jid); delete controller; handleJoinMUCRequest(invite->getJID(), boost::optional<std::string>(), boost::optional<std::string>(), false, false, true, window); return; } } else { handleJoinMUCRequest(invite->getJID(), boost::optional<std::string>(), boost::optional<std::string>(), false, false, true); return; } } //if not a mucroom if (!event->isReadable() && !isInvite && !isMediatedInvite) { /* Only route such messages if a window exists, don't open new windows for them.*/ // Do not bind a controller to a full JID, for delivery receipts or chat state notifications. bool bindControllerToJID = false; ChatState::ref chatState = message->getPayload<ChatState>(); - if (!message->getBody().empty() || (chatState && chatState->getChatState() == ChatState::Composing)) { + if (!message->getBody().get_value_or("").empty() || (chatState && chatState->getChatState() == ChatState::Composing)) { bindControllerToJID = true; } ChatController* controller = getChatControllerIfExists(jid, bindControllerToJID); if (controller) { controller->handleIncomingMessage(event); } } else { getChatControllerOrCreate(jid)->handleIncomingMessage(event); } } void ChatsManager::handleMUCSelectedAfterSearch(const JID& muc) { if (joinMUCWindow_) { joinMUCWindow_->setMUC(muc.toString()); } } void ChatsManager::handleMUCBookmarkActivated(const MUCBookmark& mucBookmark) { uiEventStream_->send(boost::make_shared<JoinMUCUIEvent>(mucBookmark.getRoom(), mucBookmark.getPassword(), mucBookmark.getNick())); } void ChatsManager::handleNewFileTransferController(FileTransferController* ftc) { ChatController* chatController = getChatControllerOrCreate(ftc->getOtherParty()); chatController->handleNewFileTransferController(ftc); chatController->activateChatWindow(); if (ftc->isIncoming()) { eventController_->handleIncomingEvent(boost::make_shared<IncomingFileTransferEvent>(ftc->getOtherParty())); } } |