diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-10-03 15:10:46 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-10-03 15:10:46 (GMT) |
commit | a719c9898cba1e5a618996ae506256a0c2556cc4 (patch) | |
tree | e811aa9a9e8cee0c25adaa608fd9c56001469bc9 /Swiften/Roster | |
parent | 0a88cbb890213472c4e780593f4bd3866f7588e4 (diff) | |
download | swift-contrib-a719c9898cba1e5a618996ae506256a0c2556cc4.zip swift-contrib-a719c9898cba1e5a618996ae506256a0c2556cc4.tar.bz2 |
Show contacts as unavailable after subscription removal.
Resolves: #455
Diffstat (limited to 'Swiften/Roster')
-rw-r--r-- | Swiften/Roster/ContactRosterItem.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Swiften/Roster/ContactRosterItem.cpp b/Swiften/Roster/ContactRosterItem.cpp index 1c27395..9251fad 100644 --- a/Swiften/Roster/ContactRosterItem.cpp +++ b/Swiften/Roster/ContactRosterItem.cpp @@ -80,8 +80,13 @@ void ContactRosterItem::applyPresence(const String& resource, boost::shared_ptr< offlinePresence_ = boost::shared_ptr<Presence>(); } if (presence->getType() == Presence::Unavailable) { - if (presences_.find(resource) != presences_.end()) { - presences_.erase(resource); + if (resource.isEmpty()) { + /* Unavailable from the bare JID means all resources are offline.*/ + presences_.clear(); + } else { + if (presences_.find(resource) != presences_.end()) { + presences_.erase(resource); + } } if (presences_.size() > 0) { offlinePresence_ = presence; |