diff options
author | Joey Hess <joey@kitenet.net> | 2012-11-02 21:36:26 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-11-02 21:36:26 -0400 |
commit | 14fa5be33c1641e3212c45c7810e460b667f59b6 (patch) | |
tree | 6342de62d92b5caf8da774c3a1ace672a7fb366b | |
parent | d08835e5eb42f39374308973aa6feb2e36b7c87f (diff) |
fix marking git-annex clients away when they disconnect
-rw-r--r-- | Assistant/XMPP/Buddies.hs | 12 |
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 |