summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-12-27 09:48:13 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-01-10 21:02:18 (GMT)
commit9c89de33df2cd52f19f067dff438547d27a81fe7 (patch)
treeb86652ceeb6a7b38ba58a4949942deacc591096d /Swift/Controllers/ChatsManager.cpp
parent3ca52c5c19d3e750f6ed8b5f7c06b78183eaabfb (diff)
downloadswift-contrib-9c89de33df2cd52f19f067dff438547d27a81fe7.zip
swift-contrib-9c89de33df2cd52f19f067dff438547d27a81fe7.tar.bz2
Don't join MUCs a second time.
Resolves: #273
Diffstat (limited to 'Swift/Controllers/ChatsManager.cpp')
-rw-r--r--Swift/Controllers/ChatsManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Swift/Controllers/ChatsManager.cpp b/Swift/Controllers/ChatsManager.cpp
index e64967c..a805802 100644
--- a/Swift/Controllers/ChatsManager.cpp
+++ b/Swift/Controllers/ChatsManager.cpp
@@ -120,8 +120,14 @@ void ChatsManager::rebindControllerJID(const JID& from, const JID& to) {
}
void ChatsManager::handleJoinMUCRequest(const JID &muc, const String &nick) {
- mucControllers_[muc] = new MUCController(jid_, muc, nick, stanzaChannel_, presenceSender_, iqRouter_, chatWindowFactory_, treeWidgetFactory_, presenceOracle_, avatarManager_);
- mucControllers_[muc]->setAvailableServerFeatures(serverDiscoInfo_);
+ std::map<JID, MUCController*>::iterator it = mucControllers_.find(muc);
+ if (it != mucControllers_.end()) {
+ //FIXME: What's correct behaviour here?
+ } else {
+ mucControllers_[muc] = new MUCController(jid_, muc, nick, stanzaChannel_, presenceSender_, iqRouter_, chatWindowFactory_, treeWidgetFactory_, presenceOracle_, avatarManager_);
+ mucControllers_[muc]->setAvailableServerFeatures(serverDiscoInfo_);
+ }
+ mucControllers_[muc]->activateChatWindow();
}
void ChatsManager::handleIncomingMessage(boost::shared_ptr<Message> message) {