core: simplify terminal mark messages read logic (#1589)

This commit is contained in:
JRoberts
2022-12-16 15:56:16 +04:00
committed by GitHub
parent 8786e2147a
commit cee403c1ed
7 changed files with 22 additions and 27 deletions
+2 -2
View File
@@ -519,7 +519,7 @@ processChatCommand = \case
withStore' $ \db -> setDirectChatItemDeleteAt db user chatId itemId deleteAt
when (ttl <= cleanupManagerInterval) $ startTimedItemThread user (ChatRef CTDirect chatId, itemId) deleteAt
withStore' $ \db -> updateDirectChatItemsRead db userId chatId fromToIds
pure CRChatRead
pure CRCmdOk
CTGroup -> do
timedItems <- withStore' $ \db -> getGroupUnreadTimedItems db user chatId fromToIds
ts <- liftIO getCurrentTime
@@ -528,7 +528,7 @@ processChatCommand = \case
withStore' $ \db -> setGroupChatItemDeleteAt db user chatId itemId deleteAt
when (ttl <= cleanupManagerInterval) $ startTimedItemThread user (ChatRef CTGroup chatId, itemId) deleteAt
withStore' $ \db -> updateGroupChatItemsRead db userId chatId fromToIds
pure CRChatRead
pure CRCmdOk
CTContactRequest -> pure $ chatCmdError "not supported"
CTContactConnection -> pure $ chatCmdError "not supported"
APIChatUnread (ChatRef cType chatId) unreadChat -> withUser $ \user -> case cType of