diff options
-rw-r--r-- | Swift/Controllers/Roster/RosterController.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Swift/Controllers/Roster/RosterController.cpp b/Swift/Controllers/Roster/RosterController.cpp index 75acaa9..4fbdea4 100644 --- a/Swift/Controllers/Roster/RosterController.cpp +++ b/Swift/Controllers/Roster/RosterController.cpp @@ -331,12 +331,17 @@ void RosterController::handleRosterSetError(ErrorPayload::ref error, boost::shar void RosterController::handleIncomingPresence(Presence::ref newPresence) { if (newPresence->getType() == Presence::Error) { return; } Presence::ref accountPresence = presenceOracle_->getAccountPresence(newPresence->getFrom().toBare()); + if (!accountPresence) { + accountPresence = Presence::create(); + accountPresence->setFrom(newPresence->getFrom()); + accountPresence->setType(Presence::Unavailable); + } roster_->applyOnItems(SetPresence(accountPresence)); } void RosterController::handleSubscriptionRequest(const JID& jid, const std::string& message) { if (xmppRoster_->containsJID(jid) && (xmppRoster_->getSubscriptionStateForJID(jid) == RosterItemPayload::To || xmppRoster_->getSubscriptionStateForJID(jid) == RosterItemPayload::Both)) { subscriptionManager_->confirmSubscription(jid); |