fix: add group mute all system notice
This commit is contained in:
@@ -5986,6 +5986,21 @@ func serveIMGroupGovernance(wrt http.ResponseWriter, req *http.Request, topic st
|
||||
nil,
|
||||
map[string]any{"member_private_chat": *body.MemberPrivateChat, "version": settings.Version})
|
||||
}
|
||||
if body.MuteAll != nil && imReliableHTTPEventsEnabled(req) {
|
||||
template := "group_mute_all_disabled"
|
||||
text := "全体禁言已关闭,普通成员将能发送任何消息。"
|
||||
if *body.MuteAll {
|
||||
template = "group_mute_all_enabled"
|
||||
text = "全体禁言已开启,普通成员将不能发送任何消息。"
|
||||
}
|
||||
publishIMConversationSystemNotice(principal.TenantID, topic,
|
||||
"system_notice", template, text,
|
||||
[]imSystemMessageActor{
|
||||
{UserID: principal.Uid.UserId(), Click: map[string]any{"type": "user_profile", "target_id": principal.Uid.UserId()}},
|
||||
},
|
||||
nil,
|
||||
map[string]any{"mute_all": *body.MuteAll, "version": settings.Version})
|
||||
}
|
||||
dispatchIMGroupEvents(principal.TenantID)
|
||||
writeIMSuccess(wrt, req, groupGovernancePayloadFromSettings(settings, selfSub))
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user