on master help sign in
Simplify server.knot: collapse GossipOnline literal, remove redundant pollResult destructure
52ab141iko
server.knot+2−4
@@ -662,11 +662,9 @@ handlePoll = \cursor authorization clientIp -> do
662 case setup of
662 case setup of
663 Nothing {} -> yield (Err {error: {status: 401, message: "unauthorized"}})
663 Nothing {} -> yield (Err {error: {status: 401, message: "unauthorized"}})
664 Just {value: s} -> do
664 Just {value: s} -> do
665− when federationEnabled (fork (sendBatchedGossip s.refreshPeers [
665+ when federationEnabled (fork (sendBatchedGossip s.refreshPeers [GossipOnline {s.pubkey}]))
666− GossipOnline {s.pubkey}
667− ]))
668 pollResult <- doPoll s t
666 pollResult <- doPoll s t
669− yield (Ok {value: {pollResult.events, pollResult.cursor}})
667+ yield (Ok {value: pollResult})
670
668
671-- One pass: collect this pubkey's unexpired messages newer than the cursor,
669-- One pass: collect this pubkey's unexpired messages newer than the cursor,
672-- sort by receivedAt, take up to `maxPollEvents`. The returned cursor is the
670-- sort by receivedAt, take up to `maxPollEvents`. The returned cursor is the