summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-11-28 11:37:47 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-11-28 11:37:47 (GMT)
commit5caf2316dad81d6c02ff3e886a65121011ccc9fe (patch)
tree1eabe5d3f5c61713d9b9e0c6d557075c97d111f9 /Swift/Controllers/Chat/ChatsManager.cpp
parentab6bac1ee3ba4ebf4dfc8dc1a3ae6783756c48c9 (diff)
downloadswift-5caf2316dad81d6c02ff3e886a65121011ccc9fe.zip
swift-5caf2316dad81d6c02ff3e886a65121011ccc9fe.tar.bz2
Rebind chat dialogs on just about anything.
Resolves: #646 Release-Notes: Duplicate chat windows when contacts are using multiple clients should now be avoided.
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 2fc5a43..6bd7597 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -133,7 +133,7 @@ void ChatsManager::handleUIEvent(boost::shared_ptr<UIEvent> event) {
*/
void ChatsManager::handlePresenceChange(boost::shared_ptr<Presence> newPresence) {
if (mucRegistry_->isMUC(newPresence->getFrom().toBare())) return;
- if (newPresence->getType() != Presence::Unavailable) return;
+ //if (newPresence->getType() != Presence::Unavailable) return;
JID fullJID(newPresence->getFrom());
std::map<JID, ChatController*>::iterator it = chatControllers_.find(fullJID);
if (it == chatControllers_.end()) return;
@@ -218,6 +218,12 @@ ChatController* ChatsManager::getChatControllerIfExists(const JID &contact) {
if (chatControllers_.find(bare) != chatControllers_.end()) {
rebindControllerJID(bare, contact);
} else {
+ foreach (JIDChatControllerPair pair, chatControllers_) {
+ if (pair.first.toBare() == contact.toBare()) {
+ rebindControllerJID(pair.first, contact);
+ return chatControllers_[contact];
+ }
+ }
return NULL;
}
}