diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-07-15 22:47:31 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-07-16 20:29:19 +0200 |
commit | 79833be3be44766a967f4f1427d9de64b14fee5b (patch) | |
tree | 4f43fa88fb9f956154f0f546266e5fd98a57c8c5 /src/Erebos | |
parent | cf0808dea948fcd3ba21de13be49aab3f03f3cc8 (diff) |
Send current chatroom subscriptions to new peers
Diffstat (limited to 'src/Erebos')
-rw-r--r-- | src/Erebos/Chatroom.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Erebos/Chatroom.hs b/src/Erebos/Chatroom.hs index be1a0e4..b2432c5 100644 --- a/src/Erebos/Chatroom.hs +++ b/src/Erebos/Chatroom.hs @@ -434,8 +434,13 @@ instance Service ChatroomService where serviceHandler spacket = do let ChatroomService {..} = fromStored spacket + + previouslyUpdated <- psSendRoomUpdates <$> svcGet svcModify $ \s -> s { psSendRoomUpdates = True } + when (not previouslyUpdated) $ do + syncChatroomsToPeer . lookupSharedValue . lsShared . fromStored =<< getLocalHead + when chatRoomQuery $ do rooms <- listChatrooms replyPacket emptyPacket |