directory: only create group links after approval (#7356)

* directory: only create group links after approval

* update test

* update messages

* diff

* get group and link in one query

* reduce database reads

* better errors

* typos

* query plans

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
Evgeny
2026-08-18 16:35:37 +01:00
committed by GitHub
co-authored by Evgeny @ SimpleX Chat
parent ebe7396fea
commit 5e45fe1f0e
10 changed files with 592 additions and 482 deletions
+1
View File
@@ -136,6 +136,7 @@ defaultChatConfig =
relayRequestExpiry = (10, nominalDay),
deviceNameForRemote = "",
remoteCompression = True,
updateGroupLinksFromApp = False,
chatHooks = defaultChatHooks
}
+1
View File
@@ -172,6 +172,7 @@ data ChatConfig = ChatConfig
highlyAvailable :: Bool,
deviceNameForRemote :: Text,
remoteCompression :: Bool,
updateGroupLinksFromApp :: Bool,
chatHooks :: ChatHooks
}
+2 -1
View File
@@ -3747,7 +3747,8 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage =
createGroupFeatureChangedItems user cd CIRcvGroupFeature g g''
-- in channels, link data is updated by the owner making the change in runUpdateGroupProfile;
-- other owners receiving the update do not refresh the same link
unless (useRelays' g'') $
ChatConfig {updateGroupLinksFromApp} <- asks config
unless (useRelays' g'' || updateGroupLinksFromApp) $
void $ forkIO $ void $ setGroupLinkData' NRMBackground user g''
Just _ -> updateGroupPrefs_ msgSigned g m $ fromMaybe defaultBusinessGroupPrefs $ groupPreferences p'
-- relay advertises its web capability now that the owner's version is known (bumped by saveGroupRcvMsg)