show when not connected to xmpp server

This commit is contained in:
Joey Hess 2013-03-06 22:02:47 -04:00
parent 15ef899b12
commit f8c2dc82d8
4 changed files with 14 additions and 6 deletions

View file

@ -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. -}