Skip to content

[O] Send banned info edits to blocked chat id#11

Open
Misaka13514 wants to merge 2 commits intoone-among-us:mainfrom
Misaka13514:ban-info-edit
Open

[O] Send banned info edits to blocked chat id#11
Misaka13514 wants to merge 2 commits intoone-among-us:mainfrom
Misaka13514:ban-info-edit

Conversation

@Misaka13514
Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings March 18, 2026 12:56
Copy link
Copy Markdown
Contributor

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

This PR updates the /edit/info submission flow so that info-edit notifications are routed to a “blocked” Telegram chat when the submitting IP is banned (or when the AI classifier marks the content as harmful), and enriches notifications/logs with GeoIP and request header context.

Changes:

  • Convert EditController to constructor injection and make the /info handler suspend to support GeoIP + AI calls.
  • Route notifications to telegramBlockedChatID for banned IPs and for HarmLevel.HARMFUL, otherwise to telegramChatID.
  • Add GeoIP, Accept-Language, and User-Agent context into the Telegram notification and server logs (with some conditional redaction of default name/email).

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

Comment thread src/main/kotlin/org/hydev/back/controller/EditController.kt
Comment thread src/main/kotlin/org/hydev/back/controller/EditController.kt
Comment thread src/main/kotlin/org/hydev/back/controller/EditController.kt
@Misaka13514
Copy link
Copy Markdown
Member Author

@hykilpikonna
Copy link
Copy Markdown
Member

对哦 突然想到

ban ipv6 的时候要不要改成 ban /56 range

@Misaka13514
Copy link
Copy Markdown
Member Author

ban ipv6 的时候要不要改成 ban /56 range

okk,我明天改下

现有ipv6数据要自动扩展还是不用管

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.

3 participants