summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant/XMPP/Buddies.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/Assistant/XMPP/Buddies.hs b/Assistant/XMPP/Buddies.hs
index db56235c7..217870dc6 100644
--- a/Assistant/XMPP/Buddies.hs
+++ b/Assistant/XMPP/Buddies.hs
@@ -63,16 +63,18 @@ applyPresence :: Presence -> Buddy -> Buddy
applyPresence p b = fromMaybe b $! go <$> presenceFrom p
where
go jid
+ | presenceType p == PresenceUnavailable = b
+ { buddyAway = addto $ buddyAway b
+ , buddyPresent = removefrom $ buddyPresent b
+ , buddyAssistants = removefrom $ buddyAssistants b
+ }
| isGitAnnexPresence p = b
- { buddyAssistants = addto $ buddyAssistants b }
+ { buddyAssistants = addto $ buddyAssistants b
+ , buddyAway = removefrom $ buddyAway b }
| presenceType p == PresenceAvailable = b
{ buddyPresent = addto $ buddyPresent b
, buddyAway = removefrom $ buddyAway b
}
- | presenceType p == PresenceUnavailable = b
- { buddyAway = addto $ buddyAway b
- , buddyPresent = removefrom $ buddyPresent b
- }
| otherwise = b
where
client = Client jid