feat: enforce friend add and curfew policies

This commit is contained in:
richjohnrambo
2026-09-18 10:55:53 +08:00
parent c6e7f6b923
commit 3a92d81fca
14 changed files with 531 additions and 42 deletions
+4
View File
@@ -1496,6 +1496,10 @@ func (t *Topic) handlePubBroadcast(msg *ClientComMessage) {
msg.Pub.Content = content
}
if msg.sess != nil && msg.sess.authLvl != auth.LevelRoot && !isCall {
if decision := imMessageCurfewDecision(t.tenantID, msg.sess.tenantCode, asUid, t.name, t.cat); !decision.Allowed {
msg.sess.queueOut(imCurfewPolicyReply(msg, decision))
return
}
scene := moderation.ScenePrivateMessage
if t.cat == types.TopicCatGrp {
scene = moderation.SceneGroupMessage