summaryrefslogtreecommitdiff
path: root/Assistant/XMPP.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-28 17:07:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-28 17:07:29 -0400
commitb64f43388c7b2c69ec0e930553363d6a419d2f45 (patch)
treea443cd05e1e14e8a79760d0ae2f035f90e190e33 /Assistant/XMPP.hs
parentcb5d8cea0c8b36a87954625add50477a74b06fe4 (diff)
send git-annex tag in initial presence
Will be used for finding other git-annex clients for pairing
Diffstat (limited to 'Assistant/XMPP.hs')
-rw-r--r--Assistant/XMPP.hs15
1 files changed, 11 insertions, 4 deletions
diff --git a/Assistant/XMPP.hs b/Assistant/XMPP.hs
index 2e38189ea..e599e2072 100644
--- a/Assistant/XMPP.hs
+++ b/Assistant/XMPP.hs
@@ -84,16 +84,23 @@ xmppCredsFile = do
dir <- fromRepo gitAnnexCredsDir
return $ dir </> "notify-xmpp"
-{- Marks the client as extended away. -}
-extendedAway :: Element
-extendedAway = Element (Name (T.pack "show") Nothing Nothing) []
- [NodeContent $ ContentText $ T.pack "xa"]
+{- A presence with a git-annex tag in it. -}
+gitAnnexPresence :: Element -> Presence
+gitAnnexPresence tag = (emptyPresence PresenceAvailable)
+ { presencePayloads = [extendedAway, tag] }
+ where
+ extendedAway = Element (Name (T.pack "show") Nothing Nothing) []
+ [NodeContent $ ContentText $ T.pack "xa"]
{- Name of a git-annex tag, in our own XML namespace.
- (Not using a namespace URL to avoid unnecessary bloat.) -}
gitAnnexTagName :: Name
gitAnnexTagName = Name (T.pack "git-annex") (Just $ T.pack "git-annex") Nothing
+{- A git-annex tag, to let other clients know we're a git-annex client too. -}
+gitAnnexSignature :: Element
+gitAnnexSignature = Element gitAnnexTagName [] []
+
pushAttr :: Name
pushAttr = Name (T.pack "push") Nothing Nothing