This commit is contained in:
spaced4ndy
2026-05-15 14:31:59 +04:00
parent 87c88daecf
commit 82c44793b1
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1582,7 +1582,7 @@ processChatCommand vr nm = \case
TestChatRelay address -> withUser $ \User {userId} ->
processChatCommand vr nm $ APITestChatRelay userId address
APIAllowRelayGroup groupId -> withUser $ \user -> do
gInfo' <- withStore $ \db -> allowRelayGroupAndSiblings db vr user groupId
gInfo' <- withStore $ \db -> allowRelayGroup db vr user groupId
pure $ CRRelayGroupAllowed user gInfo'
GetUserChatRelays -> withUser $ \user -> do
srvs <- withFastStore (`getUserServers` user)
+3 -3
View File
@@ -96,7 +96,7 @@ module Simplex.Chat.Store.Groups
updateRelayOwnStatusFromTo,
updateRelayOwnStatus_,
isRelayGroupRejected,
allowRelayGroupAndSiblings,
allowRelayGroup,
getRelayServedGroups,
getRelayInactiveGroups,
createNewContactMemberAsync,
@@ -1603,8 +1603,8 @@ updateRelayOwnStatus_ db GroupInfo {groupId} relayStatus = do
-- for the targeted groupId (whether it was flipped or not). The subquery
-- resolves the link in the same UPDATE statement so there is no
-- read-then-write race with concurrent xGrpRelayInv handlers.
allowRelayGroupAndSiblings :: DB.Connection -> VersionRangeChat -> User -> GroupId -> ExceptT StoreError IO GroupInfo
allowRelayGroupAndSiblings db vr user@User {userId} groupId = do
allowRelayGroup :: DB.Connection -> VersionRangeChat -> User -> GroupId -> ExceptT StoreError IO GroupInfo
allowRelayGroup db vr user@User {userId} groupId = do
currentTs <- liftIO getCurrentTime
liftIO $
DB.execute