summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-06-12 09:12:09 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-06-12 09:12:09 (GMT)
commita5928fb2a77e4ba899ecd67aeb2412b70945058c (patch)
tree10bfd3db7a67338f1a298b17511b729a9f0a3db9 /Swift/Controllers/Chat/ChatsManager.cpp
parent81fe3113234c0610ce49de0299f43ae12d985a14 (diff)
downloadswift-a5928fb2a77e4ba899ecd67aeb2412b70945058c.zip
swift-a5928fb2a77e4ba899ecd67aeb2412b70945058c.tar.bz2
Don't re-associate a MUC PM with the bare JID when the target goes offline.
Resolves: #458
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 1ee501a..824c98d 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -114,6 +114,7 @@ void ChatsManager::handleUIEvent(boost::shared_ptr<UIEvent> event) {
* If a resource goes offline, release bound chatdialog to that resource.
*/
void ChatsManager::handlePresenceChange(boost::shared_ptr<Presence> newPresence, boost::shared_ptr<Presence> /*lastPresence*/) {
+ if (isMUC(newPresence->getFrom().toBare())) return;
if (newPresence->getType() != Presence::Unavailable) return;
JID fullJID(newPresence->getFrom());
std::map<JID, ChatController*>::iterator it = chatControllers_.find(fullJID);
@@ -128,23 +129,6 @@ void ChatsManager::setAvatarManager(AvatarManager* avatarManager) {
avatarManager_ = avatarManager;
}
-// void ChatsManager::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) {
-// {
-// boost::shared_ptr<RequestChatUIEvent> event = boost::dynamic_pointer_cast<RequestChatUIEvent>(rawEvent);
-// if (event != NULL) {
-// handleChatRequest(event->getContact());
-// return;
-// }
-// }
-// {
-// boost::shared_ptr<JoinMUCUIEvent> event = boost::dynamic_pointer_cast<JoinMUCUIEvent>(rawEvent);
-// if (event != NULL) {
-// handleJoinMUCRequest();
-// }
-// }
-// }
-
-
void ChatsManager::setServerDiscoInfo(boost::shared_ptr<DiscoInfo> info) {
serverDiscoInfo_ = info;
foreach (JIDChatControllerPair pair, chatControllers_) {
@@ -157,7 +141,6 @@ void ChatsManager::setServerDiscoInfo(boost::shared_ptr<DiscoInfo> info) {
void ChatsManager::setEnabled(bool enabled) {
foreach (JIDChatControllerPair controllerPair, chatControllers_) {
- //printf("Setting enabled on %d to %d\n", controllerPair.second, enabled);
controllerPair.second->setEnabled(enabled);
}
foreach (JIDMUCControllerPair controllerPair, mucControllers_) {