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
handleImportant msg = case parseJID =<< isImportantNetMessage msg of
Just tojid
| tojid == baseJID tojid ->
| tojid == baseJID tojid -> do
putStanza presenceQuery
storeImportantNetMessage msg (formatJID tojid) $
\c -> (baseJID <$> parseJID c) == Just tojid
_ -> noop