This commit is contained in:
spaced4ndy
2026-05-28 19:58:54 +04:00
parent d7bccceb8b
commit 5d079a898b
2 changed files with 19 additions and 19 deletions
+12 -12
View File
@@ -2981,18 +2981,18 @@ processAgentMessageConn vr user@User {userId} corrId agentConnId agentMessage =
memberAnnouncedToView updatedMember gInfo'
pure $ deliveryJobScope updatedMember
else messageError "x.grp.mem.new: privileged role not established by roster" $> Nothing
Right unknownMember@GroupMember {memberStatus = GSMemUnknown} -> do
(updatedMember, gInfo') <- withStore $ \db -> do
updatedMember <- updateUnknownMemberAnnounced db vr user m unknownMember memInfo initialStatus
gInfo' <-
if memberPending updatedMember
then liftIO $ increaseGroupMembersRequireAttention db user gInfo
else pure gInfo
pure (updatedMember, gInfo')
gInfo'' <- updatePublicGroupData user gInfo'
toView $ CEvtUnknownMemberAnnounced user gInfo'' m unknownMember updatedMember
memberAnnouncedToView updatedMember gInfo''
pure $ deliveryJobScope updatedMember
| otherwise -> do
(updatedMember, gInfo') <- withStore $ \db -> do
updatedMember <- updateUnknownMemberAnnounced db vr user m unknownMember memInfo initialStatus
gInfo' <-
if memberPending updatedMember
then liftIO $ increaseGroupMembersRequireAttention db user gInfo
else pure gInfo
pure (updatedMember, gInfo')
gInfo'' <- updatePublicGroupData user gInfo'
toView $ CEvtUnknownMemberAnnounced user gInfo'' m unknownMember updatedMember
memberAnnouncedToView updatedMember gInfo''
pure $ deliveryJobScope updatedMember
Right _
| useRelays' gInfo -> logInfo "x.grp.mem.new: member already created via another relay" $> Nothing
| otherwise -> messageError "x.grp.mem.new error: member already exists" $> Nothing
+7 -7
View File
@@ -9525,11 +9525,11 @@ testChannelModeratorActionViaRoster ps =
cath <## "#team: you blocked dan (signed)"
bob <## "#team: cath blocked dan (signed)"
alice <## "#team: cath blocked dan (signed)"
eve <##. "#team: unknown member cath"
eve <##. "#team: bob introduced cath"
eve <## "#team: unknown member cath updated to cath"
eve <## "#team: bob introduced cath (Catherine) in the channel"
eve <## "#team: cath blocked dan (signed)"
dan <##. "#team: unknown member cath"
dan <##. "#team: bob introduced cath"
dan <## "#team: unknown member cath updated to cath"
dan <## "#team: bob introduced cath (Catherine) in the channel"
-- frank joins after the roster update; cached roster gives him cath as moderator.
-- both alice (owner) and cath (mod) receive XGrpMemNew(frank) via introduceInChannel
@@ -9567,13 +9567,13 @@ testChannelRemovedModeratorRefreshesRoster ps =
bob <## "#team: alice removed cath from the group (signed)"
cath <## "#team: alice removed you from the group (signed)"
cath <## "use /d #team to delete the group"
dan .<##. ("#team: alice removed cath", "(signed)")
eve .<##. ("#team: alice removed cath", "(signed)")
dan <## "#team: alice removed cath from the group (signed)"
eve <## "#team: alice removed cath from the group (signed)"
-- frank joins after the removal; cached roster has dropped cath
threadDelay 1000000
memberJoinChannel "team" [bob] [alice] shortLink fullLink frank
threadDelay 500000
threadDelay 100000
checkMemberRow frank "cath" Nothing
where
checkMemberRow :: HasCallStack => TestCC -> T.Text -> Maybe T.Text -> IO ()