summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-28 12:35:56 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-28 12:35:56 (GMT)
commite6ae29065d034dc23a0cc0ac4874956b931dd1c9 (patch)
treefe40164e78baefe2f23543d9b295ff4645723294
parentfa67c2b239d9c7fc508205ea17724322011194f4 (diff)
downloadswift-contrib-e6ae29065d034dc23a0cc0ac4874956b931dd1c9.zip
swift-contrib-e6ae29065d034dc23a0cc0ac4874956b931dd1c9.tar.bz2
Only handle impromptu MUC invites once.
Added missing return-statement after handling the conversion from 1-to-1 to MUC. This lead to an additional tab being opened. In addition the indentation of the relevant block was wrong and is fixed now. Test-Information: Before there was a reproducible scenario: test@A starts to chat with test2@A. toast@A is on test@A's roster, but not on test2@A's roster. test@A drops toast@A on the running chat between test@A and test2@A. test@A and test2@A end up with the chat converted into a MUC. toast@A automatically joins the MUC. test2@A additionally has a new tab. Now test2@A does not have the additional tab anymore. Only the MUC tab which previously was a 1-to-1 tab. Change-Id: I32045812952c840f0f9c6da3a9aecf5c63797b64
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 3ff2a3d..979f87a 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -889,18 +889,19 @@ void ChatsManager::handleIncomingMessage(boost::shared_ptr<Message> message) {
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);
- }
- } else {
- handleJoinMUCRequest(invite->getJID(), boost::optional<std::string>(), boost::optional<std::string>(), false, false, true);
+ // 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