From 56dde806893d7a476b9a0de9cd8523f3b9d2682d Mon Sep 17 00:00:00 2001 From: Diogo Date: Wed, 11 Dec 2024 12:00:44 +0000 Subject: [PATCH] get chat tags with supplied user id --- src/Simplex/Chat.hs | 4 ++-- src/Simplex/Chat/Controller.hs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index b1542a1257..ae86d6a1f9 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -848,7 +848,7 @@ processChatCommand' vr = \case . sortOn (timeAvg . snd) . M.assocs <$> withConnection st (readTVarIO . DB.slow) - APIGetChatTags -> withUser $ \user -> do + APIGetChatTags userId -> withUserId' userId $ \user -> do tags <- withFastStore' (`getUserChatTags` user) pure $ CRChatTags user tags APIGetChats {userId, pendingConnections, pagination, query} -> withUserId' userId $ \user -> do @@ -8421,7 +8421,7 @@ chatCommandP = "/sql chat " *> (ExecChatStoreSQL <$> textP), "/sql agent " *> (ExecAgentStoreSQL <$> textP), "/sql slow" $> SlowSQLQueries, - "/_get tags" $> APIGetChatTags, + "/_get tags" *> (APIGetChatTags <$> A.decimal), "/_get chats " *> ( APIGetChats <$> A.decimal diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index 6b772efd51..a9535bc964 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -294,7 +294,7 @@ data ChatCommand | ExecChatStoreSQL Text | ExecAgentStoreSQL Text | SlowSQLQueries - | APIGetChatTags + | APIGetChatTags UserId | APIGetChats {userId :: UserId, pendingConnections :: Bool, pagination :: PaginationByTime, query :: ChatListQuery} | APIGetChat ChatRef ChatPagination (Maybe String) | APIGetChatItems ChatPagination (Maybe String)