From b64f43388c7b2c69ec0e930553363d6a419d2f45 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 28 Oct 2012 17:07:29 -0400 Subject: send git-annex tag in initial presence Will be used for finding other git-annex clients for pairing --- Assistant/XMPP.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'Assistant/XMPP.hs') 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 -- cgit v1.2.3