Florent Fourcot wrote: > I'm looking for the status attribute, described here: > http://xmpp.org/rfcs/rfc6121.html#presence-syntax-children-status > > I tried to add it myself, but the haskell code discourages me a little bit.
This should do it, but I have not tested it beyond checking that it didn't break git-annex's xmpp push. diff --git a/Assistant/XMPP.hs b/Assistant/XMPP.hs index ed28ac7..3104f84 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 -- see shy jo
signature.asc
Description: Digital signature