Skip to content

Feat/add spamprocessor and list command#6

Open
not-meet wants to merge 2 commits into
RocketChat:feature/spam-detection-corefrom
not-meet:feat/add-spamprocessor-and-list-command
Open

Feat/add spamprocessor and list command#6
not-meet wants to merge 2 commits into
RocketChat:feature/spam-detection-corefrom
not-meet:feat/add-spamprocessor-and-list-command

Conversation

@not-meet
Copy link
Copy Markdown
Collaborator

@not-meet not-meet commented May 23, 2026

Overview

This pr adds the main pipeline of Apps.SpamMonitor consist of message analyzing gates which checks

  • Exact duplicates,
  • fuzzy/polymorphic spam,
  • cross channel monitoring,
  • Rate flood monitoring
  • Room spread monitoring
  • Url spam monitoring

additionally the PR also adds a /spammonitor list command which lets user to check the list of spammers with there username, the number of flags and level action which they are in


Files added

  • src/core/spamProcessor.ts - main spam processor class which checks the message utilizing existing cache file while increasing the level in persistence if found it as a spam
  • src/enums/notifications.ts - Adds user-facing help and notification strings.
  • src/enums/commandUtilities.ts - Adds list subcommand enum.
  • src/commands/commandUtilities.ts - Defines /spammonitor slash command and dispatches subcommands.
  • src/handlers/handler.ts- Formats and sends slash command responses (list/help/permission).

DEMO

Help notification showcasing slash commands to admins

Screencast.from.2026-05-27.00-37-57.webm

Slash command used by non admin users

Screencast.from.2026-05-27.00-39-35.webm

Case when no flagged user found

Screencast.from.2026-05-27.00-40-04.webm

showcases flagged spammer

Screencast.from.2026-05-27.00-41-23.webm

Closes #5

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a first end-to-end spam monitoring pipeline to the Rocket.Chat app: message analysis for new users, persistence of per-user “spam level” state, and an admin-facing /spammonitor list command to view flagged users.

Changes:

  • Introduces SpamProcessor + MessageCache to analyze messages for multiple spam “gates” (duplicates, cross-channel spread, rate flood, URL spam, etc.).
  • Adds persistence for user spam status (UserStatusStore) and a handler/command layer to expose /spammonitor list.
  • Wires the app into the Rocket.Chat IPostMessageSent hook and updates UI-kit/icon dependencies.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
AppsSpamMonitorApp.ts Initializes cache/processor, registers slash command, and hooks message processing into IPostMessageSent.
app.json Declares the IPostMessageSent implementation.
src/core/spamProcessor.ts Core message analysis + escalation triggers.
src/core/cache/messageCache.ts In-memory per-user message history + rate tracking.
src/persistence/userStatusStore.ts Persists and escalates per-user spam status records.
src/handlers/handler.ts Formats and sends slash command responses (list/help/permission).
src/commands/commandUtilities.ts Defines /spammonitor slash command and dispatches subcommands.
src/definition/spamlevel.ts Defines spam levels, labels, escalation thresholds, and cooldown durations.
src/definition/spamProcessor.ts Defines the analysis result contract.
src/definition/messageCache.ts Defines the cached message shape used by the cache.
src/enums/notifications.ts Adds user-facing help and notification strings.
src/enums/commandUtilities.ts Adds list subcommand enum.
package.json Updates Rocket.Chat UI-kit/icon dependency versions.
package-lock.json Lockfile updates for dependency version bumps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/commandUtilities.ts
Comment thread src/commands/commandUtilities.ts Outdated
Comment thread src/core/spamProcessor.ts Outdated
Comment thread AppsSpamMonitorApp.ts Outdated
@not-meet not-meet force-pushed the feat/add-spamprocessor-and-list-command branch from 5a28f82 to 1a39d8c Compare May 26, 2026 19:20
@not-meet not-meet marked this pull request as ready for review May 26, 2026 19:24
@not-meet
Copy link
Copy Markdown
Collaborator Author

hey @alfredodelfabro , i've added demo of the proposed command as well as fixed all the comments mentioned by copilot.
please take a look for any further review or changes

@not-meet not-meet requested a review from alfredodelfabro May 26, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants