Skip to content

Commit c8a7243

Browse files
committed
Merge branch 'master' into rcv-services
2 parents 568500c + ea70575 commit c8a7243

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Simplex/Messaging/Agent/Store/AgentStore.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,12 +2264,12 @@ getSubscriptionServers db onlyNeeded =
22642264

22652265
-- TODO [certs rcv] check index for getting queues with service present
22662266
getUserServerRcvQueueSubs :: DB.Connection -> UserId -> SMPServer -> Bool -> ServiceAssoc -> IO [RcvQueueSub]
2267-
getUserServerRcvQueueSubs db userId srv onlyNeeded hasService =
2267+
getUserServerRcvQueueSubs db userId (SMPServer h p kh) onlyNeeded hasService =
22682268
map toRcvQueueSub
22692269
<$> DB.query
22702270
db
2271-
(rcvQueueSubQuery <> toSubscribe <> " c.deleted = 0 AND q.deleted = 0 AND c.user_id = ? AND q.host = ? AND q.port = ?" <> serviceCond)
2272-
(userId, host srv, port srv)
2271+
(rcvQueueSubQuery <> toSubscribe <> " c.deleted = 0 AND q.deleted = 0 AND c.user_id = ? AND q.host = ? AND q.port = ? AND COALESCE(q.server_key_hash, s.key_hash) = ?" <> serviceCond)
2272+
(userId, h, p, kh)
22732273
where
22742274
toSubscribe
22752275
| onlyNeeded = " WHERE q.to_subscribe = 1 AND "

0 commit comments

Comments
 (0)