rpc: add android startup and messaging compat

(cherry picked from commit d718593156cc7310105007f37645948c17637e0a)
This commit is contained in:
A 2026-06-08 22:30:23 +08:00
parent fc01346160
commit b4e47c894f
11 changed files with 184 additions and 2 deletions

View file

@ -10,6 +10,17 @@ import (
// registerPayments 注册第一阶段 TDesktop 启动所需 payments.* RPC 兼容响应。
func (r *Router) registerPayments(d *tg.ServerDispatcher) {
d.OnPaymentsGetStarsStatus(func(ctx context.Context, req *tg.PaymentsGetStarsStatusRequest) (*tg.PaymentsStarsStatus, error) {
balance := tg.StarsAmountClass(&tg.StarsAmount{})
if req.GetTon() {
balance = &tg.StarsTonAmount{}
}
return &tg.PaymentsStarsStatus{
Balance: balance,
Chats: []tg.ChatClass{},
Users: []tg.UserClass{},
}, nil
})
d.OnPaymentsGetStarGiftActiveAuctions(func(ctx context.Context, hash int64) (tg.PaymentsStarGiftActiveAuctionsClass, error) {
return tdesktop.StarGiftActiveAuctions(), nil
})