Table of Contents

Class SpamGuard

Namespace
EchoHub.Server.Services
Assembly
EchoHub.Server.dll

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

options SpamOptions

Properties

Enabled

public bool Enabled { get; }

Property Value

bool

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

userId Guid
role ServerRole
nowOverride DateTimeOffset?

Returns

SpamVerdict

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

userId Guid
role ServerRole
nowOverride DateTimeOffset?

Returns

SpamVerdict

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

userId Guid
role ServerRole
content string
nowOverride DateTimeOffset?

Returns

SpamVerdict