diff options
Diffstat (limited to 'Swift/Controllers/Roster/RosterController.cpp')
-rw-r--r-- | Swift/Controllers/Roster/RosterController.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Swift/Controllers/Roster/RosterController.cpp b/Swift/Controllers/Roster/RosterController.cpp index 73efa43..751ca32 100644 --- a/Swift/Controllers/Roster/RosterController.cpp +++ b/Swift/Controllers/Roster/RosterController.cpp @@ -79,7 +79,6 @@ RosterController::RosterController(const JID& jid, XMPPRoster* xmppRoster, Avata xmppRoster_->onJIDRemoved.connect(boost::bind(&RosterController::handleOnJIDRemoved, this, _1)); xmppRoster_->onRosterCleared.connect(boost::bind(&RosterController::handleRosterCleared, this)); subscriptionManager_->onPresenceSubscriptionRequest.connect(boost::bind(&RosterController::handleSubscriptionRequest, this, _1, _2)); - presenceOracle_->onPresenceChange.connect(boost::bind(&RosterController::handleIncomingPresence, this, _1)); uiEventConnection_ = uiEventStream->onUIEvent.connect(boost::bind(&RosterController::handleUIEvent, this, _1)); vcardManager_->onOwnVCardChanged.connect(boost::bind(&RosterController::handleOwnVCardChanged, this, _1)); @@ -334,7 +333,8 @@ void RosterController::handleIncomingPresence(Presence::ref newPresence) { if (newPresence->getType() == Presence::Error) { return; } - roster_->applyOnItems(SetPresence(newPresence)); + Presence::ref accountPresence = presenceOracle_->getAccountPresence(newPresence->getFrom().toBare()); + roster_->applyOnItems(SetPresence(accountPresence)); } void RosterController::handleSubscriptionRequest(const JID& jid, const std::string& message) { @@ -380,6 +380,9 @@ void RosterController::handlePresenceChanged(Presence::ref presence) { ownContact_->applyPresence(std::string(), presence); mainWindow_->setMyContactRosterItem(ownContact_); } + else { + handleIncomingPresence(presence); + } } boost::optional<XMPPRosterItem> RosterController::getItem(const JID& jid) const { |