mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #7033] [MERGED] fix(tgbot): let clients page their screens and see usage per account #6588
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6588
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/7033
Author: @orshih6
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @MHSanaei
Base:
main← Head:contribot/issue-7032📝 Commits (2)
2d06179fix(tgbot): let clients page their screens and see usage per account1805551Merge branch 'main' into contribot/issue-7032📊 Changes
3 files changed (+76 additions, -9 deletions)
View changed files
📝
internal/web/service/tgbot/screen_client_views.go(+18 -9)📝
internal/web/service/tgbot/screens_test.go(+55 -0)📝
internal/web/service/tgbot/tgbot_router.go(+3 -0)📄 Description
A client bound to several accounts gets a home screen long enough to be split into pages. But
pg:next,pg:prevandpg:nonewere not inisClientSelfCallback, so the gate inanswerCallbacksilently dropped every page tap from a non-admin. Paging only re-renders the screen already stored for the caller's own chat and carries no target of its own, so it is now allowed for clients alongsidehomeandhide.The second problem: tapping one of those accounts opened
screenClientLinks, which showed only the subscription URL. The links screen still offered the "client card" button, which sends the admin-onlyclient_get_usagecallback, so for a client it was another dead button. The old check hid that button only when the client had exactly one subscription.ownSubscriptionOnlyis nowownClientTraffic: for a non-admin who owns the email, it returns that account's traffic. The links screen shows that usage at the top (the sameclientInfoMsgfields the home screen shows) and leaves out the admin card. Ownership of the email is already checked in the router before this screen is drawn. Admins see the screen exactly as before.Tests in
screens_test.go:TestClientCanTurnPages: the gate allowspg:*, and a non-admin tapping next on a multi-page screen moves it to page 2.TestLinksScreenShowsUsageToItsOwner: a client with two accounts sees usage on the links screen and gets noclient_get_usagebutton.Both fail without the change.
go test ./internal/web/service/tgbot/,go vetandgofmtpass.Fixes #7032
This change was prepared with an AI coding agent (Claude) and reviewed by me before submitting. I'm happy to make any changes you'd like.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #7033] fix(tgbot): let clients page their screens and see usage per accountto [PR #7033] [MERGED] fix(tgbot): let clients page their screens and see usage per account