diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-07-16 20:24:39 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-07-16 20:24:39 (GMT) |
commit | 5adcba3ba42a0f7cfde8dfdf6aa6f322077c3744 (patch) | |
tree | 47cc5ea588b5508a29b70cd353a0bbff853cf389 | |
parent | 63b311c1bb60469eb5e2ccd2107739e11b189a15 (diff) | |
download | swift-contrib-5adcba3ba42a0f7cfde8dfdf6aa6f322077c3744.zip swift-contrib-5adcba3ba42a0f7cfde8dfdf6aa6f322077c3744.tar.bz2 |
Show the correct (unavailable) presence for a MUC in the recents list after leaving.
Resolves: #932
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 5c0475d..05017e7 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -265,18 +265,20 @@ void ChatsManager::prependRecent(const ChatListWindow::Chat& chat) { } void ChatsManager::handleUserLeftMUC(MUCController* mucController) { std::map<JID, MUCController*>::iterator it; for (it = mucControllers_.begin(); it != mucControllers_.end(); ++it) { if ((*it).second == mucController) { foreach (ChatListWindow::Chat& chat, recentChats_) { if (chat.isMUC && chat.jid == (*it).first) { chat.statusType = StatusShow::None; + chatListWindow_->setRecents(recentChats_); + break; } } mucControllers_.erase(it); delete mucController; return; } } } @@ -318,19 +320,19 @@ 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) { if (mucRegistry_->isMUC(newPresence->getFrom().toBare())) return; foreach (ChatListWindow::Chat& chat, recentChats_) { - if (newPresence->getFrom().toBare() == chat.jid.toBare()) { + if (newPresence->getFrom().toBare() == chat.jid.toBare() && !chat.isMUC) { Presence::ref presence = presenceOracle_->getHighestPriorityPresence(chat.jid.toBare()); chat.setStatusType(presence ? presence->getShow() : StatusShow::None); chatListWindow_->setRecents(recentChats_); break; } } //if (newPresence->getType() != Presence::Unavailable) return; JID fullJID(newPresence->getFrom()); |