@@ -272,15 +272,26 @@ getConversationsImpl cids = do
272272 (otr_archived :: boolean?), (otr_archived_ref :: text?), (hidden :: boolean?), (hidden_ref :: text?), (conversation_role :: text?)
273273 FROM conversation_member
274274 WHERE conv = ANY ($1 :: uuid[])
275- OR conv IN (SELECT parent_conv FROM conversation WHERE id = ANY ($1 :: uuid[]))
275+
276+ UNION ALL
277+
278+ SELECT (conv :: uuid), ("user" :: uuid), (service :: uuid?), (provider :: uuid?), (otr_muted_status :: integer?), (otr_muted_ref :: text?),
279+ (otr_archived :: boolean?), (otr_archived_ref :: text?), (hidden :: boolean?), (hidden_ref :: text?), (conversation_role :: text?)
280+ FROM conversation_member
281+ WHERE conv IN (SELECT parent_conv FROM conversation WHERE id = ANY ($1 :: uuid[]))
276282 |]
277283 selectAllRemoteMembers :: Hasql. Statement [ConvId ] [RemoteMemberRow ]
278284 selectAllRemoteMembers =
279285 dimapPG @ [_ ] @ (Vector _ )
280286 [vectorStatement |SELECT (conv :: uuid), (user_remote_domain :: text), (user_remote_id :: uuid), (conversation_role :: text)
281287 FROM local_conversation_remote_member
282288 WHERE conv = ANY ($1 :: uuid[])
283- OR conv IN (SELECT parent_conv FROM conversation WHERE id = ANY ($1 :: uuid[]))
289+
290+ UNION ALL
291+
292+ SELECT (conv :: uuid), (user_remote_domain :: text), (user_remote_id :: uuid), (conversation_role :: text)
293+ FROM local_conversation_remote_member
294+ WHERE conv IN (SELECT parent_conv FROM conversation WHERE id = ANY ($1 :: uuid[]))
284295 |]
285296
286297 findMembers :: (HasField " id_" a b , Eq b ) => ConvId -> Maybe ConvId -> [(ConvId , a )] -> [a ]
0 commit comments