fix: improve message handling by using senderID for identification#320
Open
cointem wants to merge 1 commit intosipeed:mainfrom
Open
fix: improve message handling by using senderID for identification#320cointem wants to merge 1 commit intosipeed:mainfrom
cointem wants to merge 1 commit intosipeed:mainfrom
Conversation
Author
|
refs #310 |
There was a problem hiding this comment.
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.
Collaborator
|
@Zepan Uses Recommendation: Merge. +2/-1, trivial but important for multi-user scenarios. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复了pkg/channels/telegram.go文件夹下handleMessage方法校验senderID不一致的bug。

** 第一次校验senderID **
** 第二次调用HandleMessage也应该传senderID进行校验 **

旧代码:
新代码:
