aboutsummaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-07 03:50:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-07 03:50:21 -0400
commit872164b7ef1262d1d8baa9b2f3f3a3be0afb40e9 (patch)
treed0296069f47913a304d3b8861430edbf64a3635f /Assistant
parent69f270d68ec3f658fa857ab5a523314fd518cd6f (diff)
empty buddy list when client is connecting
This is not perfect, because on loss of connection, we do not currently immediately detect it and stop the client. It has to time out, and then the buddy list will clear. The NetWatcher should detect disconnects too..
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/XMPPClient.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Assistant/Threads/XMPPClient.hs b/Assistant/Threads/XMPPClient.hs
index 833151e79..e6ac209d6 100644
--- a/Assistant/Threads/XMPPClient.hs
+++ b/Assistant/Threads/XMPPClient.hs
@@ -62,6 +62,11 @@ xmppClient urlrenderer d creds =
- if it keeps failing, back off to wait 5 minutes before
- trying it again. -}
retry client starttime = do
+ {- The buddy list starts empty each time
+ - the client connects, so that stale info
+ - is not retained. -}
+ liftAssistant $
+ updateBuddyList (const noBuddies) <<~ buddyList
e <- client
liftAssistant $ modifyDaemonStatus_ $ \s -> s
{ xmppClientID = Nothing }
@@ -83,11 +88,6 @@ xmppClient urlrenderer d creds =
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. -}
- void $ inAssistant $
- updateBuddyList (const noBuddies) <<~ buddyList
xmppThread $ receivenotifications selfjid
forever $ do