xmpp: send a presence query when there's an important message to send

This may work around google talk's horrible presence handling, in which
clients often don't learn about other clients, at least when using the same
account. This way, every time we start a git push over xmpp, we'll waste
bandwidth asking clients to please try again to identify themselves.
This commit is contained in:
Joey Hess 2013-03-16 15:34:02 -04:00
parent e3354cf19c
commit 55f20ae099
2 changed files with 4 additions and 1 deletions

View file

@ -184,7 +184,8 @@ relayNetMessage selfjid = do
where where
handleImportant msg = case parseJID =<< isImportantNetMessage msg of handleImportant msg = case parseJID =<< isImportantNetMessage msg of
Just tojid Just tojid
| tojid == baseJID tojid -> | tojid == baseJID tojid -> do
putStanza presenceQuery
storeImportantNetMessage msg (formatJID tojid) $ storeImportantNetMessage msg (formatJID tojid) $
\c -> (baseJID <$> parseJID c) == Just tojid \c -> (baseJID <$> parseJID c) == Just tojid
_ -> noop _ -> noop

2
debian/changelog vendored
View file

@ -9,6 +9,8 @@ git-annex (4.20130315) UNRELEASED; urgency=low
* webapp: Encourage user to install git-annex on a server when adding * webapp: Encourage user to install git-annex on a server when adding
a ssh server, rather than just funneling them through to rsync. a ssh server, rather than just funneling them through to rsync.
* xmpp: --debug now enables a sanitized dump of the XMPP protocol * 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.
-- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400 -- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400