summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-16 15:37:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-16 16:00:37 -0400
commit0d967326df6332d701e39206d3389b4770735397 (patch)
treeee1935781f6398685cc04322bdf9c93c168f477e
parente49fedcb95420362ee2c37540e095ba430f64372 (diff)
xmpp: Re-enable XA flag, since disabling it did not turn out to help with the problems Google Talk has with not always sending presence messages to clients.
-rw-r--r--Assistant/Threads/XMPPClient.hs9
-rw-r--r--Assistant/XMPP.hs7
-rw-r--r--debian/changelog3
-rw-r--r--doc/design/assistant/xmpp.mdwn3
4 files changed, 15 insertions, 7 deletions
diff --git a/Assistant/Threads/XMPPClient.hs b/Assistant/Threads/XMPPClient.hs
index d31bfea6f..79bb33b0e 100644
--- a/Assistant/Threads/XMPPClient.hs
+++ b/Assistant/Threads/XMPPClient.hs
@@ -179,16 +179,17 @@ relayNetMessage :: JID -> Assistant (XMPP ())
relayNetMessage selfjid = do
msg <- waitNetMessage
debug ["sending:", show $ sanitizeNetMessage msg]
- handleImportant msg
- convert msg
+ a1 <- handleImportant msg
+ a2 <- convert msg
+ return (a1 >> a2)
where
handleImportant msg = case parseJID =<< isImportantNetMessage msg of
Just tojid
| tojid == baseJID tojid -> do
- putStanza presenceQuery
storeImportantNetMessage msg (formatJID tojid) $
\c -> (baseJID <$> parseJID c) == Just tojid
- _ -> noop
+ return $ putStanza presenceQuery
+ _ -> return noop
convert (Pushing c pushstage) = withOtherClient selfjid c $ \tojid -> do
if tojid == baseJID tojid
then do
diff --git a/Assistant/XMPP.hs b/Assistant/XMPP.hs
index 49cc82368..2c0004403 100644
--- a/Assistant/XMPP.hs
+++ b/Assistant/XMPP.hs
@@ -52,8 +52,9 @@ instance GitAnnexTaggable Message where
extractGitAnnexTag = headMaybe . filter isGitAnnexTag . messagePayloads
instance GitAnnexTaggable Presence where
+ -- always mark extended away and set presence priority to negative
insertGitAnnexTag p elt = p
- { presencePayloads = negativePriority : elt : presencePayloads p }
+ { presencePayloads = extendedAway : negativePriority : elt : presencePayloads p }
extractGitAnnexTag = headMaybe . filter isGitAnnexTag . presencePayloads
data GitAnnexTagInfo = GitAnnexTagInfo
@@ -204,6 +205,10 @@ silentMessage = (emptyMessage MessageChat)
, elementNodes = []
}
+{- Add to a presence to mark its client as extended away. -}
+extendedAway :: Element
+extendedAway = Element "show" [] [NodeContent $ ContentText "xa"]
+
{- Add to a presence to give it a negative priority. -}
negativePriority :: Element
negativePriority = Element "priority" [] [NodeContent $ ContentText "-1"]
diff --git a/debian/changelog b/debian/changelog
index 2b22a46c4..d8833865f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,9 @@ git-annex (4.20130315) UNRELEASED; urgency=low
* xmpp: --debug now enables a sanitized dump of the XMPP protocol
* xmpp: Try harder to detect presence of clients when there's a git push
to send.
+ * xmpp: Re-enable XA flag, since disabling it did not turn out to help
+ with the problems Google Talk has with not always sending presence
+ messages to clients.
-- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400
diff --git a/doc/design/assistant/xmpp.mdwn b/doc/design/assistant/xmpp.mdwn
index 5f6d367fb..fed79527e 100644
--- a/doc/design/assistant/xmpp.mdwn
+++ b/doc/design/assistant/xmpp.mdwn
@@ -39,8 +39,7 @@ using presence messages, and chat messages (with empty body tags,
so clients don't display them).
git-annex sets a negative presence priority, to avoid any regular messages
-getting eaten by its clients. It also sets itself extended away. (XA
-no longer used; see 90e47088908c2374d5d9306f4dacdf22de599cf5.)
+getting eaten by its clients. It also sets itself extended away.
Note that this means that chat messages always have to be directed at
specific git-annex clients.