diff options
author | Joey Hess <joey@kitenet.net> | 2013-07-25 14:58:30 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-07-25 14:58:30 -0400 |
commit | 14225f5b2ea3b6d91d1bb22c20aca57e6d75d23d (patch) | |
tree | 93505636cad02b94095c3edf62fa825a4fa43244 /Assistant | |
parent | c8052664e4ad3e9ab3ca18b8ea94ce1e5914f878 (diff) |
add status tag to all presence messages
Necessary for push messages to not override the previously sent tag.
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/XMPP.hs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Assistant/XMPP.hs b/Assistant/XMPP.hs index 3104f844d..0360ce860 100644 --- a/Assistant/XMPP.hs +++ b/Assistant/XMPP.hs @@ -75,23 +75,21 @@ gitAnnexTagInfo v = case extractGitAnnexTag v of <*> pure tag _ -> Nothing -{- A presence with a git-annex tag in it. -} +{- A presence with a git-annex tag in it. + - Also includes a status tag, which may be visible in XMPP clients. -} gitAnnexPresence :: Element -> Presence -gitAnnexPresence = insertGitAnnexTag $ emptyPresence PresenceAvailable - -{- A presence with an empty git-annex tag in it, used for letting other - - clients know we're around and are a git-annex client. - - - - Also includes a status tag, which may be visible in XMPP clients. - -} -gitAnnexSignature :: Presence -gitAnnexSignature = addStatusTag $ gitAnnexPresence $ Element gitAnnexTagName [] [] +gitAnnexPresence = insertGitAnnexTag $ addStatusTag $ emptyPresence PresenceAvailable where addStatusTag p = p { presencePayloads = status : presencePayloads p } status = Element "status" [] [statusMessage] statusMessage = NodeContent $ ContentText $ T.pack "git-annex" +{- A presence with an empty git-annex tag in it, used for letting other + - clients know we're around and are a git-annex client. -} +gitAnnexSignature :: Presence +gitAnnexSignature = gitAnnexPresence $ Element gitAnnexTagName [] [] + {- XMPP client to server ping -} xmppPing :: JID -> IQ xmppPing selfjid = (emptyIQ IQGet) |