Class SpamGuard
In-memory, per-user spam protection consulted from ChatService (messages, joins) and ChannelService (channel creation), so every ingress protocol — SignalR and IRC alike — shares the same limits. State is per-process and never persisted; auto-mutes land in the normal mute store. Operates only on content the server already stores (for end-to-end encrypted rooms that is ciphertext) — nothing is decrypted.
public sealed class SpamGuard
- Inheritance
-
SpamGuard
- Inherited Members
Constructors
SpamGuard(SpamOptions)
public SpamGuard(SpamOptions options)
Parameters
optionsSpamOptions
Properties
Enabled
public bool Enabled { get; }
Property Value
Methods
CheckChannelCreate(Guid, ServerRole, DateTimeOffset?)
Checks a channel creation. Rejections count as violations but never auto-mute.
public SpamVerdict CheckChannelCreate(Guid userId, ServerRole role, DateTimeOffset? nowOverride = null)
Parameters
userIdGuidroleServerRolenowOverrideDateTimeOffset?
Returns
CheckJoin(Guid, ServerRole, DateTimeOffset?)
Checks a channel join. Rejections count as violations but never auto-mute.
public SpamVerdict CheckJoin(Guid userId, ServerRole role, DateTimeOffset? nowOverride = null)
Parameters
userIdGuidroleServerRolenowOverrideDateTimeOffset?
Returns
CheckMessage(Guid, ServerRole, string, DateTimeOffset?)
Checks a message send. Rejections count as violations; enough violations inside the violation window escalate to AutoMute (evaluated only on rejected messages, so a clean message never mutes anyone).
public SpamVerdict CheckMessage(Guid userId, ServerRole role, string content, DateTimeOffset? nowOverride = null)
Parameters
userIdGuidroleServerRolecontentstringnowOverrideDateTimeOffset?