Skip to content

fix: improve message handling by using senderID for identification#320

Open
cointem wants to merge 1 commit intosipeed:mainfrom
cointem:main
Open

fix: improve message handling by using senderID for identification#320
cointem wants to merge 1 commit intosipeed:mainfrom
cointem:main

Conversation

@cointem
Copy link

@cointem cointem commented Feb 16, 2026

修复了pkg/channels/telegram.go文件夹下handleMessage方法校验senderID不一致的bug。
** 第一次校验senderID **
image

** 第二次调用HandleMessage也应该传senderID进行校验 **
旧代码:
image

新代码:
image

Copilot AI review requested due to automatic review settings February 16, 2026 15:55
@cointem
Copy link
Author

cointem commented Feb 16, 2026

refs #310

Copy link

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 fixes a bug in the Telegram channel where the senderID used for initial allowlist validation was inconsistent with the senderID passed to HandleMessage. The senderID variable can include both the user ID and username (format: "ID|username"), but the old code only passed the numeric user ID to HandleMessage, causing potential authorization issues when usernames are used in the allowlist.

Changes:

  • Fixed inconsistent senderID usage in handleMessage by passing the senderID variable (which may include username) instead of just the numeric user.ID
  • Added a blank line between Start() and Stop() methods for consistent formatting

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

@Leeaandrob
Copy link
Collaborator

@Zepan Uses senderID instead of chatID for message identification — ensures correct attribution in group chats.

Recommendation: Merge. +2/-1, trivial but important for multi-user scenarios.

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