summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-07-23 12:41:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-07-23 12:41:41 -0400
commitb0e8ed12fadd6b5b46e01800f716dfd60bcbbe46 (patch)
treee010d381f6b722baa1db193f18a65a4f7bea8d84 /Assistant
parenta37140d60fabdc372975a493376fcdaebbd50d54 (diff)
Add status message to XMPP presence tag, to identify to others that the client is a git-annex client.
I only added this to the presense messages that are really intended for presence. The ones used for tunneling git etc don't have the tag, because that would waste bandwidth.
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/XMPP.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Assistant/XMPP.hs b/Assistant/XMPP.hs
index ed28ac7d2..3104f844d 100644
--- a/Assistant/XMPP.hs
+++ b/Assistant/XMPP.hs
@@ -80,9 +80,17 @@ 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. -}
+ - 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 = gitAnnexPresence $ Element gitAnnexTagName [] []
+gitAnnexSignature = addStatusTag $ gitAnnexPresence $ Element gitAnnexTagName [] []
+ where
+ addStatusTag p = p
+ { presencePayloads = status : presencePayloads p }
+ status = Element "status" [] [statusMessage]
+ statusMessage = NodeContent $ ContentText $ T.pack "git-annex"
{- XMPP client to server ping -}
xmppPing :: JID -> IQ