Skip to content

Conversation

@Zabuzard
Copy link
Member

@Zabuzard Zabuzard commented Jul 15, 2025

Summary

Closes #1278. Extends ScamBlocker to detect image-only scam messages, plus unit tests.

Details

As described in the ticket, messages are now flagged as scam if:

  • empty message (isBlank())
  • amount of suspicious attachments is greater than configed (suspiciousAttachmentsThreshold)
  • an attachment is considered suspicious if it is an image (IsImage()) and its name matches the configured regex pattern suspiciousAttachmentNamePattern

The file name pattern is configured by default as desired in the ticket description. That is, it triggers on files like image.png or files with 1-2 digits like 1.jpg or 23.png.

Config

Added two new config params (part of "scamBlocker" config):

"suspiciousAttachmentsThreshold": 3,
"suspiciousAttachmentNamePattern": "(image|\\d{1,2})\\.[^.]{0,5}"

Impressions

bad post

is flagged

Added two new config params:
* suspiciousAttachmentsThreshold
* suspiciousAttachmentNamePattern
@Zabuzard Zabuzard self-assigned this Jul 15, 2025
@Zabuzard Zabuzard requested a review from a team as a code owner July 15, 2025 14:07
@Zabuzard Zabuzard added enhancement New feature or request priority: major config-changes if your PR contains any changes related to config file labels Jul 15, 2025
@sonarqubecloud
Copy link

@Zabuzard Zabuzard merged commit 82a8932 into develop Jul 16, 2025
11 checks passed
@Zabuzard Zabuzard deleted the feature/block_image_scam branch July 16, 2025 06:55
@Zabuzard Zabuzard mentioned this pull request Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config-changes if your PR contains any changes related to config file enhancement New feature or request priority: major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block Picture-Scam

2 participants