This commit is contained in:
Joey Hess 2012-11-10 01:40:50 -04:00
parent c0fab69f85
commit 16b2472574

View file

@ -96,17 +96,15 @@ xmppClient urlrenderer d = do
handle _ (GotNetMessage (NotifyPush us)) = void $ inAssistant $ pull us handle _ (GotNetMessage (NotifyPush us)) = void $ inAssistant $ pull us
handle selfjid (GotNetMessage (PairingNotification stage c u)) = handle selfjid (GotNetMessage (PairingNotification stage c u)) =
maybe noop (inAssistant . pairMsgReceived urlrenderer stage u selfjid) (parseJID c) maybe noop (inAssistant . pairMsgReceived urlrenderer stage u selfjid) (parseJID c)
handle _ (GotNetMessage m@(CanPush _)) = handlepushmsg m handle _ (GotNetMessage pushmsg)
handle _ (GotNetMessage m@(PushRequest _)) = handlepushmsg m | isPushInitiationMessage pushmsg = inAssistant $
handle _ (GotNetMessage m@(StartingPush _)) = handlepushmsg m unlessM (queueNetPushMessage pushmsg) $
handle _ (GotNetMessage m) = void $ inAssistant $ queueNetPushMessage m void $ forkIO <~> handlePushMessage pushmsg
| otherwise = void $ inAssistant $ queueNetPushMessage pushmsg
handle _ (Ignorable _) = noop handle _ (Ignorable _) = noop
handle _ (Unknown _) = noop handle _ (Unknown _) = noop
handle _ (ProtocolError _) = noop handle _ (ProtocolError _) = noop
handlepushmsg m = inAssistant $
unlessM (queueNetPushMessage m) $
void $ forkIO <~> handlePushMessage m
data XMPPEvent data XMPPEvent
= GotNetMessage NetMessage = GotNetMessage NetMessage