fix build

This commit is contained in:
Joey Hess 2013-07-08 12:53:08 -04:00
parent 57f5c9f41a
commit b6d857da08

View file

@ -363,15 +363,16 @@ withPushMessagesInSequence cid side a = loop 0
loop seqnum = do loop seqnum = do
m <- timeout xmppTimeout <~> waitInbox cid side m <- timeout xmppTimeout <~> waitInbox cid side
let go s = a m >> loop s let go s = a m >> loop s
let next = seqnum + 1
case extractSequence =<< m of case extractSequence =<< m of
Just seqnum' Just seqnum'
| seqnum' == seqnum + 1 -> go seqnum' | seqnum' == next -> go next
| seqnum' == 0 -> go seqnum | seqnum' == 0 -> go seqnum
| seqnum' == seqnum -> do | seqnum' == seqnum -> do
debug ["ignoring duplicate sequence number", show seqnum] debug ["ignoring duplicate sequence number", show seqnum]
loop seqnum loop seqnum
| otherwise -> do | otherwise -> do
debug ["ignoring out of order sequence number", show seqnum', "expected", show seqnum + 1] debug ["ignoring out of order sequence number", show seqnum', "expected", show next]
loop seqnum loop seqnum
Nothing -> go seqnum Nothing -> go seqnum