diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-21 11:06:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-21 11:08:08 -0400 |
commit | 901f2c9e218cdba36e2488c413f9e620337f3283 (patch) | |
tree | 494c5049e25c9440157a6f59441ec908c49fbad9 /Assistant/Threads | |
parent | 18bf809758a1d42a19de9d056ef35cb9c7221dac (diff) |
per-client inboxes for push messages
This will avoid losing any messages received from 1 client when a push
involving another client is running.
Additionally, the handling of push initiation is improved,
it's no longer allowed to run multiples of the same type of push to
the same client.
Still stalls sometimes :(
Diffstat (limited to 'Assistant/Threads')
-rw-r--r-- | Assistant/Threads/XMPPClient.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Assistant/Threads/XMPPClient.hs b/Assistant/Threads/XMPPClient.hs index dd1b2ac1f..929b4c807 100644 --- a/Assistant/Threads/XMPPClient.hs +++ b/Assistant/Threads/XMPPClient.hs @@ -108,11 +108,10 @@ xmppClient urlrenderer d creds = maybe noop (inAssistant . pairMsgReceived urlrenderer stage u selfjid) (parseJID c) handle _ (GotNetMessage m@(Pushing _ pushstage)) | isPushNotice pushstage = inAssistant $ handlePushNotice m - | isPushInitiation pushstage = inAssistant $ - unlessM (queueNetPushMessage m) $ do - let checker = checkCloudRepos urlrenderer - void $ forkIO <~> handlePushInitiation checker m - | otherwise = void $ inAssistant $ queueNetPushMessage m + | isPushInitiation pushstage = inAssistant $ do + let checker = checkCloudRepos urlrenderer + void $ forkIO <~> handlePushInitiation checker m + | otherwise = void $ inAssistant $ storeInbox m handle _ (Ignorable _) = noop handle _ (Unknown _) = noop handle _ (ProtocolError _) = noop |