fix: sync WebK compatibility paths
This commit is contained in:
parent
766c5db992
commit
76bfc5100f
12 changed files with 387 additions and 8 deletions
25
internal/rpc/messages_received.go
Normal file
25
internal/rpc/messages_received.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/iamxvbaba/td/tg"
|
||||
)
|
||||
|
||||
// onMessagesReceivedMessages acknowledges the client's highest observed
|
||||
// message id. telesrv does not enqueue mobile PUSH notifications, so there are
|
||||
// no pending notifications to cancel and the exact cancellation set is empty.
|
||||
// This acknowledgement must never advance read boundaries or update state.
|
||||
func (r *Router) onMessagesReceivedMessages(ctx context.Context, _ int) ([]tg.ReceivedNotifyMessage, error) {
|
||||
userID, authorized, err := r.currentUserID(ctx)
|
||||
if err != nil {
|
||||
return nil, internalErr()
|
||||
}
|
||||
if !authorized || userID == 0 {
|
||||
return nil, authKeyUnregisteredErr()
|
||||
}
|
||||
if r.userIsBot(ctx, userID) {
|
||||
return nil, botMethodInvalidErr()
|
||||
}
|
||||
return []tg.ReceivedNotifyMessage{}, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue