diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-11-08 22:39:28 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-11-08 22:39:28 (GMT) |
commit | 8774d67aabd02086ec0663bb4567cef14bd513c6 (patch) | |
tree | bfb723ecc9b1fd528b1da3135a5cfd401c44a268 /Swift/Controllers/RosterController.cpp | |
parent | a594eb3fef7e047d1eca7959d7734d4d10fd1eb7 (diff) | |
download | swift-contrib-8774d67aabd02086ec0663bb4567cef14bd513c6.zip swift-contrib-8774d67aabd02086ec0663bb4567cef14bd513c6.tar.bz2 |
Brute force application of presence to roster items on add/modify.
Resolves: #655
Resolves: #672
Release-Notes: The roster should no longer sometimes show online users as offline.
Diffstat (limited to 'Swift/Controllers/RosterController.cpp')
-rw-r--r-- | Swift/Controllers/RosterController.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Swift/Controllers/RosterController.cpp b/Swift/Controllers/RosterController.cpp index 242f974..4df8d13 100644 --- a/Swift/Controllers/RosterController.cpp +++ b/Swift/Controllers/RosterController.cpp @@ -115,6 +115,13 @@ void RosterController::handleOnJIDAdded(const JID& jid) { else { roster_->addContact(jid, jid, name, "Contacts", avatarManager_->getAvatarPath(jid).string()); } + applyAllPresenceTo(jid); +} + +void RosterController::applyAllPresenceTo(const JID& jid) { + foreach (Presence::ref presence, presenceOracle_->getAllPresence(jid)) { + roster_->applyOnItems(SetPresence(presence)); + } } void RosterController::handleRosterCleared() { @@ -150,10 +157,7 @@ void RosterController::handleOnJIDUpdated(const JID& jid, const String& oldName, roster_->removeContactFromGroup(jid, group); } } - Presence::ref presence(presenceOracle_->getHighestPriorityPresence(jid)); - if (presence) { - roster_->applyOnItems(SetPresence(presence)); - } + applyAllPresenceTo(jid); } void RosterController::handleUIEvent(boost::shared_ptr<UIEvent> event) { |