diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-06 22:02:47 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-06 22:02:47 -0400 |
commit | 82a9a3bd5c5cc15323e0f7c3a56ed3df46b8d19a (patch) | |
tree | 01633ee6bb9b3651dda8528931b6b36bafc540a5 /Assistant/Threads/XMPPClient.hs | |
parent | 4581ce68361c0d318c325af99a961b67de01e958 (diff) |
show when not connected to xmpp server
Diffstat (limited to 'Assistant/Threads/XMPPClient.hs')
-rw-r--r-- | Assistant/Threads/XMPPClient.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Assistant/Threads/XMPPClient.hs b/Assistant/Threads/XMPPClient.hs index 0b639cf60..833151e79 100644 --- a/Assistant/Threads/XMPPClient.hs +++ b/Assistant/Threads/XMPPClient.hs @@ -47,8 +47,6 @@ restartableClient a = forever $ go =<< liftAnnex getXMPPCreds where go Nothing = waitNetMessagerRestart go (Just creds) = do - modifyDaemonStatus_ $ \s -> s - { xmppClientID = Just $ xmppJID creds } tid <- liftIO $ forkIO $ a creds waitNetMessagerRestart liftIO $ killThread tid @@ -65,6 +63,8 @@ xmppClient urlrenderer d creds = - trying it again. -} retry client starttime = do e <- client + liftAssistant $ modifyDaemonStatus_ $ \s -> s + { xmppClientID = Nothing } now <- getCurrentTime if diffUTCTime now starttime > 300 then do @@ -79,7 +79,10 @@ xmppClient urlrenderer d creds = selfjid <- bindJID jid putStanza gitAnnexSignature - inAssistant $ debug ["connected", show selfjid] + inAssistant $ do + modifyDaemonStatus_ $ \s -> s + { xmppClientID = Just $ xmppJID creds } + debug ["connected", show selfjid] {- The buddy list starts empty each time - the client connects, so that stale info - is not retained. -} |