rpc: add android startup and messaging compat
(cherry picked from commit d718593156cc7310105007f37645948c17637e0a)
This commit is contained in:
parent
fc01346160
commit
b4e47c894f
11 changed files with 184 additions and 2 deletions
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue