fix marking git-annex clients away when they disconnect

This commit is contained in:
Joey Hess 2012-11-02 21:36:26 -04:00
parent 54fcfd42d2
commit a6d15938ab
2 changed files with 16 additions and 10 deletions

View file

@ -63,15 +63,17 @@ applyPresence :: Presence -> Buddy -> Buddy
applyPresence p b = fromMaybe b $! go <$> presenceFrom p
where
go jid
| isGitAnnexPresence p = b
{ buddyAssistants = addto $ buddyAssistants 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
, buddyAssistants = removefrom $ buddyAssistants b
}
| isGitAnnexPresence p = b
{ buddyAssistants = addto $ buddyAssistants b
, buddyAway = removefrom $ buddyAway b }
| presenceType p == PresenceAvailable = b
{ buddyPresent = addto $ buddyPresent b
, buddyAway = removefrom $ buddyAway b
}
| otherwise = b
where

View file

@ -16,8 +16,12 @@
$else
#{name}
<td>
$if canpair
<a .btn .btn-primary .btn-small href="@{StartXMPPPairR buddyid}">
Start pairing
$if away
<span .muted>
away
$else
not using git-annex
$if canpair
<a .btn .btn-primary .btn-small href="@{StartXMPPPairR buddyid}">
Start pairing
$else
not using git-annex