Merge branch 'master' into f/channel-comments

This commit is contained in:
spaced4ndy
2026-04-09 14:24:35 +04:00
3 changed files with 85 additions and 4 deletions
+5 -1
View File
@@ -1213,6 +1213,9 @@ sendHistory user gInfo@GroupInfo {membership} m@GroupMember {activeConn = Just c
where
descrEvent_ :: Maybe (ChatMsgEvent 'Json)
descrEvent_
-- in channels sendHistory runs on the relay, which cannot author XMsgNew (GRRelay < GRObserver);
-- the welcome message reaches new members via the channel link data instead
| useRelays' gInfo = Nothing
| m `supportsVersion` groupHistoryIncludeWelcomeVersion = do
let GroupInfo {groupProfile = GroupProfile {description}} = gInfo
fmap (\descr -> XMsgNew $ mcSimple (MCText descr)) description
@@ -1317,7 +1320,8 @@ setGroupLinkData nm user gInfo gLink = do
(conn, groupRelays) <- withFastStore $ \db ->
(,) <$> getGroupLinkConnection db vr user gInfo <*> liftIO (getConnectedGroupRelays db gInfo)
let (userLinkData, crClientData) = groupLinkData gInfo gLink groupRelays
sLnk <- shortenShortLink' . toShortGroupLink =<< withAgent (\a -> setConnShortLink a nm (aConnId conn) SCMContact userLinkData (Just crClientData))
tagShortLink = if useRelays' gInfo then toShortChannelLink else toShortGroupLink
sLnk <- shortenShortLink' . tagShortLink =<< withAgent (\a -> setConnShortLink a nm (aConnId conn) SCMContact userLinkData (Just crClientData))
withFastStore' $ \db -> setGroupLinkShortLink db gLink sLnk
setGroupLinkDataAsync :: User -> GroupInfo -> GroupLink -> CM ()
+4 -1
View File
@@ -3154,7 +3154,10 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
(ci, cInfo) <- saveRcvChatItemNoParse user cd msg brokerTs (CIRcvGroupEvent $ RGEGroupUpdated p')
groupMsgToView cInfo ci
createGroupFeatureChangedItems user cd CIRcvGroupFeature g g''
void $ forkIO $ void $ setGroupLinkData' NRMBackground user 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'') $
void $ forkIO $ void $ setGroupLinkData' NRMBackground user g''
Just _ -> updateGroupPrefs_ msgSigned g m $ fromMaybe defaultBusinessGroupPrefs $ groupPreferences p'
pure $ Just DJSGroup {jobSpec = DJDeliveryJob {includePending = True}}