admin: add account spam restriction (join/message gate)
Adds a narrower spam sanction alongside the existing account freeze: a restricted account keeps every existing membership and conversation, but cannot join new channels/groups (public join or invite link) and cannot start a new conversation with a non-contact. Reachable both as a standalone admin action and as a decision on a reported user's moderation case, with the same idempotent-supersession and appeal wiring freeze already has.
This commit is contained in:
parent
3ca8ef1a16
commit
f33e25af8d
32 changed files with 750 additions and 44 deletions
|
|
@ -131,6 +131,9 @@ func (r *Router) sendOutgoing(ctx context.Context, userID int64, peer domain.Pee
|
|||
if err := r.ensurePrivateContactAllowed(ctx, userID, peer.ID, p.allowPaidStars, 1); err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if err := r.ensureNotRestrictedFromMessaging(ctx, userID, peer.ID); err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if err := r.ensureVoiceMessagesAllowed(ctx, userID, peer, p.media != nil && p.media.HasUnreadPayload()); err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
|
|
@ -544,6 +547,9 @@ func (r *Router) onMessagesSendMultiMedia(ctx context.Context, req *tg.MessagesS
|
|||
if err := r.ensurePrivateContactAllowed(ctx, userID, peer.ID, req.AllowPaidStars, absentCount); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := r.ensureNotRestrictedFromMessaging(ctx, userID, peer.ID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
pendingMedia := make([]tg.InputMediaClass, 0, absentCount)
|
||||
for i, item := range req.MultiMedia {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue