summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Presence/PresenceOracle.cpp')
-rw-r--r--Swiften/Presence/PresenceOracle.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Swiften/Presence/PresenceOracle.cpp b/Swiften/Presence/PresenceOracle.cpp
index 83bbbf7..fb4be3f 100644
--- a/Swiften/Presence/PresenceOracle.cpp
+++ b/Swiften/Presence/PresenceOracle.cpp
@@ -52,7 +52,11 @@ void PresenceOracle::handleIncomingPresence(Presence::ref presence) {
/* Don't have a bare-JID only offline presence once there are available presences */
jidMap.erase(bareJID);
}
- jidMap[passedPresence->getFrom()] = passedPresence;
+ if (passedPresence->getType() == Presence::Unavailable && jidMap.size() > 1) {
+ jidMap.erase(passedPresence->getFrom());
+ } else {
+ jidMap[passedPresence->getFrom()] = passedPresence;
+ }
entries_[bareJID] = jidMap;
onPresenceChange(passedPresence);
}