core: fix search in chat (#5677)

This commit is contained in:
Evgeny 2025-02-27 07:38:40 +00:00 committed by GitHub
parent 1fcb352db4
commit b482d4d812
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1260,7 +1260,7 @@ getGroupChatItemIDs db User {userId} GroupInfo {groupId} contentFilter range cou
(orParams ts itemId)
" ORDER BY item_ts DESC, chat_item_id DESC "
where
orCond c1 c2 = " (" <> c <> " AND " <> c1 <> ") OR (" <> c <> " AND " <> c2 <> ") "
orCond c1 c2 = " ((" <> c <> " AND " <> c1 <> ") OR (" <> c <> " AND " <> c2 <> ")) "
orParams ts itemId = (p :. (Only ts) :. p :. (ts, itemId))
rangeQuery :: ToRow p => Query -> p -> Query -> IO [ChatItemId]
rangeQuery c p ob