summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-10-03 15:10:46 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-10-03 15:10:46 (GMT)
commita719c9898cba1e5a618996ae506256a0c2556cc4 (patch)
treee811aa9a9e8cee0c25adaa608fd9c56001469bc9 /Swift/Controllers
parent0a88cbb890213472c4e780593f4bd3866f7588e4 (diff)
downloadswift-a719c9898cba1e5a618996ae506256a0c2556cc4.zip
swift-a719c9898cba1e5a618996ae506256a0c2556cc4.tar.bz2
Show contacts as unavailable after subscription removal.
Resolves: #455
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/RosterController.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Swift/Controllers/RosterController.cpp b/Swift/Controllers/RosterController.cpp
index 5288df1..96056ca 100644
--- a/Swift/Controllers/RosterController.cpp
+++ b/Swift/Controllers/RosterController.cpp
@@ -146,7 +146,6 @@ void RosterController::handleOnJIDUpdated(const JID& jid, const String& oldName,
roster_->removeContactFromGroup(jid, group);
}
}
-
}
void RosterController::handleUIEvent(boost::shared_ptr<UIEvent> event) {
@@ -225,7 +224,13 @@ void RosterController::handleRosterSetError(boost::optional<ErrorPayload> error,
}
void RosterController::handleIncomingPresence(boost::shared_ptr<Presence> newPresence) {
- roster_->applyOnItems(SetPresence(newPresence));
+ boost::shared_ptr<Presence> appliedPresence(newPresence);
+ if (newPresence->getType() == Presence::Unsubscribe) {
+ /* In 3921bis, subscription removal isn't followed by a presence push of unavailable*/
+ appliedPresence = boost::shared_ptr<Presence>(new Presence());
+ appliedPresence->setFrom(newPresence->getFrom().toBare());
+ }
+ roster_->applyOnItems(SetPresence(appliedPresence));
}
void RosterController::handleSubscriptionRequest(const JID& jid, const String& message) {