fix(security): 修复宵禁策略未生效于群聊话题的问题
添加注释说明宵禁仅作用于私聊和群聊,同时将话题类型判断从仅私聊扩展至群聊,确保两类消息话题均会应用宵禁策略。
This commit is contained in:
@@ -206,7 +206,8 @@ func imFriendEntryBlocked(policy map[string]any, entry string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func imMessageCurfewDecision(tenantID types.TenantID, tenantCode string, actor types.Uid, topic string, cat types.TopicCat) imPolicyDecision {
|
func imMessageCurfewDecision(tenantID types.TenantID, tenantCode string, actor types.Uid, topic string, cat types.TopicCat) imPolicyDecision {
|
||||||
if cat != types.TopicCatP2P {
|
// 宵禁只作用于私聊与群聊两类消息话题;me/fnd 等非消息话题直接放行。
|
||||||
|
if cat != types.TopicCatP2P && cat != types.TopicCatGrp {
|
||||||
return imAllowDecision()
|
return imAllowDecision()
|
||||||
}
|
}
|
||||||
policy, err := imSecurityPolicy(tenantID, tenantCode)
|
policy, err := imSecurityPolicy(tenantID, tenantCode)
|
||||||
|
|||||||
Reference in New Issue
Block a user