You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7544 lines
216 KiB
7544 lines
216 KiB
// Code generated by gotdgen, DO NOT EDIT. |
|
|
|
package tg |
|
|
|
import ( |
|
"context" |
|
"errors" |
|
"fmt" |
|
"sort" |
|
"strings" |
|
|
|
"go.uber.org/multierr" |
|
|
|
"github.com/gotd/td/bin" |
|
"github.com/gotd/td/tdjson" |
|
"github.com/gotd/td/tdp" |
|
"github.com/gotd/td/tgerr" |
|
) |
|
|
|
// No-op definition for keeping imports. |
|
var ( |
|
_ = bin.Buffer{} |
|
_ = context.Background() |
|
_ = fmt.Stringer(nil) |
|
_ = strings.Builder{} |
|
_ = errors.Is |
|
_ = multierr.AppendInto |
|
_ = sort.Ints |
|
_ = tdp.Format |
|
_ = tgerr.Error{} |
|
_ = tdjson.Encoder{} |
|
) |
|
|
|
type ServerDispatcher struct { |
|
fallback func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) |
|
handlers map[uint32]func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) |
|
} |
|
|
|
func NewServerDispatcher(fallback func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error)) *ServerDispatcher { |
|
return &ServerDispatcher{ |
|
fallback: fallback, |
|
handlers: map[uint32]func(context.Context, *bin.Buffer) (bin.Encoder, error){}, |
|
} |
|
} |
|
|
|
func (s *ServerDispatcher) Handle(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
id, err := b.PeekID() |
|
if err != nil { |
|
return nil, err |
|
} |
|
|
|
f, ok := s.handlers[id] |
|
if !ok { |
|
return s.fallback(ctx, b) |
|
} |
|
|
|
return f(ctx, b) |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthSendCode(f func(ctx context.Context, request *AuthSendCodeRequest) (*AuthSentCode, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthSendCodeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AuthSendCodeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthSignUp(f func(ctx context.Context, request *AuthSignUpRequest) (AuthAuthorizationClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthSignUpRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AuthAuthorizationBox{Authorization: response}, nil |
|
} |
|
|
|
s.handlers[AuthSignUpRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthSignIn(f func(ctx context.Context, request *AuthSignInRequest) (AuthAuthorizationClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthSignInRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AuthAuthorizationBox{Authorization: response}, nil |
|
} |
|
|
|
s.handlers[AuthSignInRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthLogOut(f func(ctx context.Context) (*AuthLoggedOut, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthLogOutRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AuthLogOutRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthResetAuthorizations(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthResetAuthorizationsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AuthResetAuthorizationsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthExportAuthorization(f func(ctx context.Context, dcid int) (*AuthExportedAuthorization, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthExportAuthorizationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.DCID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AuthExportAuthorizationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthImportAuthorization(f func(ctx context.Context, request *AuthImportAuthorizationRequest) (AuthAuthorizationClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthImportAuthorizationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AuthAuthorizationBox{Authorization: response}, nil |
|
} |
|
|
|
s.handlers[AuthImportAuthorizationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthBindTempAuthKey(f func(ctx context.Context, request *AuthBindTempAuthKeyRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthBindTempAuthKeyRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AuthBindTempAuthKeyRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthImportBotAuthorization(f func(ctx context.Context, request *AuthImportBotAuthorizationRequest) (AuthAuthorizationClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthImportBotAuthorizationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AuthAuthorizationBox{Authorization: response}, nil |
|
} |
|
|
|
s.handlers[AuthImportBotAuthorizationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthCheckPassword(f func(ctx context.Context, password InputCheckPasswordSRPClass) (AuthAuthorizationClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthCheckPasswordRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Password) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AuthAuthorizationBox{Authorization: response}, nil |
|
} |
|
|
|
s.handlers[AuthCheckPasswordRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthRequestPasswordRecovery(f func(ctx context.Context) (*AuthPasswordRecovery, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthRequestPasswordRecoveryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AuthRequestPasswordRecoveryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthRecoverPassword(f func(ctx context.Context, request *AuthRecoverPasswordRequest) (AuthAuthorizationClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthRecoverPasswordRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AuthAuthorizationBox{Authorization: response}, nil |
|
} |
|
|
|
s.handlers[AuthRecoverPasswordRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthResendCode(f func(ctx context.Context, request *AuthResendCodeRequest) (*AuthSentCode, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthResendCodeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AuthResendCodeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthCancelCode(f func(ctx context.Context, request *AuthCancelCodeRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthCancelCodeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AuthCancelCodeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthDropTempAuthKeys(f func(ctx context.Context, exceptauthkeys []int64) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthDropTempAuthKeysRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ExceptAuthKeys) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AuthDropTempAuthKeysRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthExportLoginToken(f func(ctx context.Context, request *AuthExportLoginTokenRequest) (AuthLoginTokenClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthExportLoginTokenRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AuthLoginTokenBox{LoginToken: response}, nil |
|
} |
|
|
|
s.handlers[AuthExportLoginTokenRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthImportLoginToken(f func(ctx context.Context, token []byte) (AuthLoginTokenClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthImportLoginTokenRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Token) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AuthLoginTokenBox{LoginToken: response}, nil |
|
} |
|
|
|
s.handlers[AuthImportLoginTokenRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthAcceptLoginToken(f func(ctx context.Context, token []byte) (*Authorization, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthAcceptLoginTokenRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Token) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AuthAcceptLoginTokenRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAuthCheckRecoveryPassword(f func(ctx context.Context, code string) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AuthCheckRecoveryPasswordRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Code) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AuthCheckRecoveryPasswordRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountRegisterDevice(f func(ctx context.Context, request *AccountRegisterDeviceRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountRegisterDeviceRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountRegisterDeviceRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUnregisterDevice(f func(ctx context.Context, request *AccountUnregisterDeviceRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUnregisterDeviceRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountUnregisterDeviceRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUpdateNotifySettings(f func(ctx context.Context, request *AccountUpdateNotifySettingsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUpdateNotifySettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountUpdateNotifySettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetNotifySettings(f func(ctx context.Context, peer InputNotifyPeerClass) (*PeerNotifySettings, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetNotifySettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetNotifySettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountResetNotifySettings(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountResetNotifySettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountResetNotifySettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUpdateProfile(f func(ctx context.Context, request *AccountUpdateProfileRequest) (UserClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUpdateProfileRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UserBox{User: response}, nil |
|
} |
|
|
|
s.handlers[AccountUpdateProfileRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUpdateStatus(f func(ctx context.Context, offline bool) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUpdateStatusRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Offline) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountUpdateStatusRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetWallPapers(f func(ctx context.Context, hash int64) (AccountWallPapersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetWallPapersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AccountWallPapersBox{WallPapers: response}, nil |
|
} |
|
|
|
s.handlers[AccountGetWallPapersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountReportPeer(f func(ctx context.Context, request *AccountReportPeerRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountReportPeerRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountReportPeerRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountCheckUsername(f func(ctx context.Context, username string) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountCheckUsernameRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Username) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountCheckUsernameRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUpdateUsername(f func(ctx context.Context, username string) (UserClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUpdateUsernameRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Username) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UserBox{User: response}, nil |
|
} |
|
|
|
s.handlers[AccountUpdateUsernameRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetPrivacy(f func(ctx context.Context, key InputPrivacyKeyClass) (*AccountPrivacyRules, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetPrivacyRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Key) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetPrivacyRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSetPrivacy(f func(ctx context.Context, request *AccountSetPrivacyRequest) (*AccountPrivacyRules, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSetPrivacyRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountSetPrivacyRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountDeleteAccount(f func(ctx context.Context, reason string) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountDeleteAccountRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Reason) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountDeleteAccountRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetAccountTTL(f func(ctx context.Context) (*AccountDaysTTL, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetAccountTTLRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetAccountTTLRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSetAccountTTL(f func(ctx context.Context, ttl AccountDaysTTL) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSetAccountTTLRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.TTL) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountSetAccountTTLRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSendChangePhoneCode(f func(ctx context.Context, request *AccountSendChangePhoneCodeRequest) (*AuthSentCode, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSendChangePhoneCodeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountSendChangePhoneCodeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountChangePhone(f func(ctx context.Context, request *AccountChangePhoneRequest) (UserClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountChangePhoneRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UserBox{User: response}, nil |
|
} |
|
|
|
s.handlers[AccountChangePhoneRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUpdateDeviceLocked(f func(ctx context.Context, period int) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUpdateDeviceLockedRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Period) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountUpdateDeviceLockedRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetAuthorizations(f func(ctx context.Context) (*AccountAuthorizations, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetAuthorizationsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetAuthorizationsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountResetAuthorization(f func(ctx context.Context, hash int64) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountResetAuthorizationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountResetAuthorizationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetPassword(f func(ctx context.Context) (*AccountPassword, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetPasswordRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetPasswordRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetPasswordSettings(f func(ctx context.Context, password InputCheckPasswordSRPClass) (*AccountPasswordSettings, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetPasswordSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Password) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetPasswordSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUpdatePasswordSettings(f func(ctx context.Context, request *AccountUpdatePasswordSettingsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUpdatePasswordSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountUpdatePasswordSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSendConfirmPhoneCode(f func(ctx context.Context, request *AccountSendConfirmPhoneCodeRequest) (*AuthSentCode, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSendConfirmPhoneCodeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountSendConfirmPhoneCodeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountConfirmPhone(f func(ctx context.Context, request *AccountConfirmPhoneRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountConfirmPhoneRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountConfirmPhoneRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetTmpPassword(f func(ctx context.Context, request *AccountGetTmpPasswordRequest) (*AccountTmpPassword, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetTmpPasswordRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetTmpPasswordRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetWebAuthorizations(f func(ctx context.Context) (*AccountWebAuthorizations, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetWebAuthorizationsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetWebAuthorizationsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountResetWebAuthorization(f func(ctx context.Context, hash int64) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountResetWebAuthorizationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountResetWebAuthorizationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountResetWebAuthorizations(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountResetWebAuthorizationsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountResetWebAuthorizationsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetAllSecureValues(f func(ctx context.Context) ([]SecureValue, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetAllSecureValuesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &SecureValueVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[AccountGetAllSecureValuesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetSecureValue(f func(ctx context.Context, types []SecureValueTypeClass) ([]SecureValue, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetSecureValueRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Types) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &SecureValueVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[AccountGetSecureValueRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSaveSecureValue(f func(ctx context.Context, request *AccountSaveSecureValueRequest) (*SecureValue, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSaveSecureValueRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountSaveSecureValueRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountDeleteSecureValue(f func(ctx context.Context, types []SecureValueTypeClass) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountDeleteSecureValueRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Types) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountDeleteSecureValueRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetAuthorizationForm(f func(ctx context.Context, request *AccountGetAuthorizationFormRequest) (*AccountAuthorizationForm, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetAuthorizationFormRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetAuthorizationFormRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountAcceptAuthorization(f func(ctx context.Context, request *AccountAcceptAuthorizationRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountAcceptAuthorizationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountAcceptAuthorizationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSendVerifyPhoneCode(f func(ctx context.Context, request *AccountSendVerifyPhoneCodeRequest) (*AuthSentCode, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSendVerifyPhoneCodeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountSendVerifyPhoneCodeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountVerifyPhone(f func(ctx context.Context, request *AccountVerifyPhoneRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountVerifyPhoneRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountVerifyPhoneRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSendVerifyEmailCode(f func(ctx context.Context, email string) (*AccountSentEmailCode, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSendVerifyEmailCodeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Email) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountSendVerifyEmailCodeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountVerifyEmail(f func(ctx context.Context, request *AccountVerifyEmailRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountVerifyEmailRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountVerifyEmailRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountInitTakeoutSession(f func(ctx context.Context, request *AccountInitTakeoutSessionRequest) (*AccountTakeout, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountInitTakeoutSessionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountInitTakeoutSessionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountFinishTakeoutSession(f func(ctx context.Context, request *AccountFinishTakeoutSessionRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountFinishTakeoutSessionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountFinishTakeoutSessionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountConfirmPasswordEmail(f func(ctx context.Context, code string) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountConfirmPasswordEmailRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Code) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountConfirmPasswordEmailRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountResendPasswordEmail(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountResendPasswordEmailRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountResendPasswordEmailRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountCancelPasswordEmail(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountCancelPasswordEmailRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountCancelPasswordEmailRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetContactSignUpNotification(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetContactSignUpNotificationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountGetContactSignUpNotificationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSetContactSignUpNotification(f func(ctx context.Context, silent bool) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSetContactSignUpNotificationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Silent) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountSetContactSignUpNotificationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetNotifyExceptions(f func(ctx context.Context, request *AccountGetNotifyExceptionsRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetNotifyExceptionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[AccountGetNotifyExceptionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetWallPaper(f func(ctx context.Context, wallpaper InputWallPaperClass) (WallPaperClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetWallPaperRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Wallpaper) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &WallPaperBox{WallPaper: response}, nil |
|
} |
|
|
|
s.handlers[AccountGetWallPaperRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUploadWallPaper(f func(ctx context.Context, request *AccountUploadWallPaperRequest) (WallPaperClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUploadWallPaperRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &WallPaperBox{WallPaper: response}, nil |
|
} |
|
|
|
s.handlers[AccountUploadWallPaperRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSaveWallPaper(f func(ctx context.Context, request *AccountSaveWallPaperRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSaveWallPaperRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountSaveWallPaperRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountInstallWallPaper(f func(ctx context.Context, request *AccountInstallWallPaperRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountInstallWallPaperRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountInstallWallPaperRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountResetWallPapers(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountResetWallPapersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountResetWallPapersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetAutoDownloadSettings(f func(ctx context.Context) (*AccountAutoDownloadSettings, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetAutoDownloadSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetAutoDownloadSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSaveAutoDownloadSettings(f func(ctx context.Context, request *AccountSaveAutoDownloadSettingsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSaveAutoDownloadSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountSaveAutoDownloadSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUploadTheme(f func(ctx context.Context, request *AccountUploadThemeRequest) (DocumentClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUploadThemeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &DocumentBox{Document: response}, nil |
|
} |
|
|
|
s.handlers[AccountUploadThemeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountCreateTheme(f func(ctx context.Context, request *AccountCreateThemeRequest) (*Theme, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountCreateThemeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountCreateThemeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountUpdateTheme(f func(ctx context.Context, request *AccountUpdateThemeRequest) (*Theme, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountUpdateThemeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountUpdateThemeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSaveTheme(f func(ctx context.Context, request *AccountSaveThemeRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSaveThemeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountSaveThemeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountInstallTheme(f func(ctx context.Context, request *AccountInstallThemeRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountInstallThemeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountInstallThemeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetTheme(f func(ctx context.Context, request *AccountGetThemeRequest) (*Theme, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetThemeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetThemeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetThemes(f func(ctx context.Context, request *AccountGetThemesRequest) (AccountThemesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetThemesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AccountThemesBox{Themes: response}, nil |
|
} |
|
|
|
s.handlers[AccountGetThemesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSetContentSettings(f func(ctx context.Context, request *AccountSetContentSettingsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSetContentSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountSetContentSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetContentSettings(f func(ctx context.Context) (*AccountContentSettings, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetContentSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetContentSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetMultiWallPapers(f func(ctx context.Context, wallpapers []InputWallPaperClass) ([]WallPaperClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetMultiWallPapersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Wallpapers) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &WallPaperClassVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[AccountGetMultiWallPapersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetGlobalPrivacySettings(f func(ctx context.Context) (*GlobalPrivacySettings, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetGlobalPrivacySettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountGetGlobalPrivacySettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSetGlobalPrivacySettings(f func(ctx context.Context, settings GlobalPrivacySettings) (*GlobalPrivacySettings, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSetGlobalPrivacySettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Settings) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[AccountSetGlobalPrivacySettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountReportProfilePhoto(f func(ctx context.Context, request *AccountReportProfilePhotoRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountReportProfilePhotoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountReportProfilePhotoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountResetPassword(f func(ctx context.Context) (AccountResetPasswordResultClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountResetPasswordRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AccountResetPasswordResultBox{ResetPasswordResult: response}, nil |
|
} |
|
|
|
s.handlers[AccountResetPasswordRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountDeclinePasswordReset(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountDeclinePasswordResetRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountDeclinePasswordResetRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountGetChatThemes(f func(ctx context.Context, hash int64) (AccountThemesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountGetChatThemesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &AccountThemesBox{Themes: response}, nil |
|
} |
|
|
|
s.handlers[AccountGetChatThemesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountSetAuthorizationTTL(f func(ctx context.Context, authorizationttldays int) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountSetAuthorizationTTLRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.AuthorizationTTLDays) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountSetAuthorizationTTLRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnAccountChangeAuthorizationSettings(f func(ctx context.Context, request *AccountChangeAuthorizationSettingsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request AccountChangeAuthorizationSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[AccountChangeAuthorizationSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUsersGetUsers(f func(ctx context.Context, id []InputUserClass) ([]UserClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UsersGetUsersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UserClassVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[UsersGetUsersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUsersGetFullUser(f func(ctx context.Context, id InputUserClass) (*UsersUserFull, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UsersGetFullUserRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[UsersGetFullUserRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUsersSetSecureValueErrors(f func(ctx context.Context, request *UsersSetSecureValueErrorsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UsersSetSecureValueErrorsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[UsersSetSecureValueErrorsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsGetContactIDs(f func(ctx context.Context, hash int64) ([]int, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsGetContactIDsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &IntVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[ContactsGetContactIDsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsGetStatuses(f func(ctx context.Context) ([]ContactStatus, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsGetStatusesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &ContactStatusVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[ContactsGetStatusesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsGetContacts(f func(ctx context.Context, hash int64) (ContactsContactsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsGetContactsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &ContactsContactsBox{Contacts: response}, nil |
|
} |
|
|
|
s.handlers[ContactsGetContactsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsImportContacts(f func(ctx context.Context, contacts []InputPhoneContact) (*ContactsImportedContacts, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsImportContactsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Contacts) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ContactsImportContactsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsDeleteContacts(f func(ctx context.Context, id []InputUserClass) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsDeleteContactsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ContactsDeleteContactsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsDeleteByPhones(f func(ctx context.Context, phones []string) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsDeleteByPhonesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Phones) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ContactsDeleteByPhonesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsBlock(f func(ctx context.Context, id InputPeerClass) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsBlockRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ContactsBlockRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsUnblock(f func(ctx context.Context, id InputPeerClass) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsUnblockRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ContactsUnblockRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsGetBlocked(f func(ctx context.Context, request *ContactsGetBlockedRequest) (ContactsBlockedClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsGetBlockedRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &ContactsBlockedBox{Blocked: response}, nil |
|
} |
|
|
|
s.handlers[ContactsGetBlockedRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsSearch(f func(ctx context.Context, request *ContactsSearchRequest) (*ContactsFound, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsSearchRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ContactsSearchRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsResolveUsername(f func(ctx context.Context, username string) (*ContactsResolvedPeer, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsResolveUsernameRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Username) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ContactsResolveUsernameRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsGetTopPeers(f func(ctx context.Context, request *ContactsGetTopPeersRequest) (ContactsTopPeersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsGetTopPeersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &ContactsTopPeersBox{TopPeers: response}, nil |
|
} |
|
|
|
s.handlers[ContactsGetTopPeersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsResetTopPeerRating(f func(ctx context.Context, request *ContactsResetTopPeerRatingRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsResetTopPeerRatingRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ContactsResetTopPeerRatingRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsResetSaved(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsResetSavedRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ContactsResetSavedRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsGetSaved(f func(ctx context.Context) ([]SavedPhoneContact, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsGetSavedRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &SavedPhoneContactVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[ContactsGetSavedRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsToggleTopPeers(f func(ctx context.Context, enabled bool) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsToggleTopPeersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Enabled) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ContactsToggleTopPeersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsAddContact(f func(ctx context.Context, request *ContactsAddContactRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsAddContactRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ContactsAddContactRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsAcceptContact(f func(ctx context.Context, id InputUserClass) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsAcceptContactRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ContactsAcceptContactRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsGetLocated(f func(ctx context.Context, request *ContactsGetLocatedRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsGetLocatedRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ContactsGetLocatedRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsBlockFromReplies(f func(ctx context.Context, request *ContactsBlockFromRepliesRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsBlockFromRepliesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ContactsBlockFromRepliesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnContactsResolvePhone(f func(ctx context.Context, phone string) (*ContactsResolvedPeer, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ContactsResolvePhoneRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Phone) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ContactsResolvePhoneRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetMessages(f func(ctx context.Context, id []InputMessageClass) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetDialogs(f func(ctx context.Context, request *MessagesGetDialogsRequest) (MessagesDialogsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetDialogsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesDialogsBox{Dialogs: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetDialogsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetHistory(f func(ctx context.Context, request *MessagesGetHistoryRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSearch(f func(ctx context.Context, request *MessagesSearchRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSearchRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSearchRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReadHistory(f func(ctx context.Context, request *MessagesReadHistoryRequest) (*MessagesAffectedMessages, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReadHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesReadHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDeleteHistory(f func(ctx context.Context, request *MessagesDeleteHistoryRequest) (*MessagesAffectedHistory, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDeleteHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesDeleteHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDeleteMessages(f func(ctx context.Context, request *MessagesDeleteMessagesRequest) (*MessagesAffectedMessages, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDeleteMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesDeleteMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReceivedMessages(f func(ctx context.Context, maxid int) ([]ReceivedNotifyMessage, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReceivedMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.MaxID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &ReceivedNotifyMessageVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesReceivedMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetTyping(f func(ctx context.Context, request *MessagesSetTypingRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetTypingRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSetTypingRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendMessage(f func(ctx context.Context, request *MessagesSendMessageRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendMessageRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendMessageRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendMedia(f func(ctx context.Context, request *MessagesSendMediaRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendMediaRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendMediaRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesForwardMessages(f func(ctx context.Context, request *MessagesForwardMessagesRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesForwardMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesForwardMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReportSpam(f func(ctx context.Context, peer InputPeerClass) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReportSpamRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesReportSpamRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetPeerSettings(f func(ctx context.Context, peer InputPeerClass) (*MessagesPeerSettings, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetPeerSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetPeerSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReport(f func(ctx context.Context, request *MessagesReportRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReportRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesReportRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetChats(f func(ctx context.Context, id []int64) (MessagesChatsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetChatsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesChatsBox{Chats: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetChatsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetFullChat(f func(ctx context.Context, chatid int64) (*MessagesChatFull, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetFullChatRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ChatID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetFullChatRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesEditChatTitle(f func(ctx context.Context, request *MessagesEditChatTitleRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesEditChatTitleRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesEditChatTitleRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesEditChatPhoto(f func(ctx context.Context, request *MessagesEditChatPhotoRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesEditChatPhotoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesEditChatPhotoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesAddChatUser(f func(ctx context.Context, request *MessagesAddChatUserRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesAddChatUserRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesAddChatUserRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDeleteChatUser(f func(ctx context.Context, request *MessagesDeleteChatUserRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDeleteChatUserRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesDeleteChatUserRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesCreateChat(f func(ctx context.Context, request *MessagesCreateChatRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesCreateChatRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesCreateChatRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetDhConfig(f func(ctx context.Context, request *MessagesGetDhConfigRequest) (MessagesDhConfigClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetDhConfigRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesDhConfigBox{DhConfig: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetDhConfigRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesRequestEncryption(f func(ctx context.Context, request *MessagesRequestEncryptionRequest) (EncryptedChatClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesRequestEncryptionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &EncryptedChatBox{EncryptedChat: response}, nil |
|
} |
|
|
|
s.handlers[MessagesRequestEncryptionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesAcceptEncryption(f func(ctx context.Context, request *MessagesAcceptEncryptionRequest) (EncryptedChatClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesAcceptEncryptionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &EncryptedChatBox{EncryptedChat: response}, nil |
|
} |
|
|
|
s.handlers[MessagesAcceptEncryptionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDiscardEncryption(f func(ctx context.Context, request *MessagesDiscardEncryptionRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDiscardEncryptionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesDiscardEncryptionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetEncryptedTyping(f func(ctx context.Context, request *MessagesSetEncryptedTypingRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetEncryptedTypingRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSetEncryptedTypingRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReadEncryptedHistory(f func(ctx context.Context, request *MessagesReadEncryptedHistoryRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReadEncryptedHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesReadEncryptedHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendEncrypted(f func(ctx context.Context, request *MessagesSendEncryptedRequest) (MessagesSentEncryptedMessageClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendEncryptedRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesSentEncryptedMessageBox{SentEncryptedMessage: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendEncryptedRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendEncryptedFile(f func(ctx context.Context, request *MessagesSendEncryptedFileRequest) (MessagesSentEncryptedMessageClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendEncryptedFileRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesSentEncryptedMessageBox{SentEncryptedMessage: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendEncryptedFileRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendEncryptedService(f func(ctx context.Context, request *MessagesSendEncryptedServiceRequest) (MessagesSentEncryptedMessageClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendEncryptedServiceRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesSentEncryptedMessageBox{SentEncryptedMessage: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendEncryptedServiceRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReceivedQueue(f func(ctx context.Context, maxqts int) ([]int64, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReceivedQueueRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.MaxQts) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &LongVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesReceivedQueueRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReportEncryptedSpam(f func(ctx context.Context, peer InputEncryptedChat) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReportEncryptedSpamRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesReportEncryptedSpamRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReadMessageContents(f func(ctx context.Context, id []int) (*MessagesAffectedMessages, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReadMessageContentsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesReadMessageContentsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetStickers(f func(ctx context.Context, request *MessagesGetStickersRequest) (MessagesStickersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesStickersBox{Stickers: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetAllStickers(f func(ctx context.Context, hash int64) (MessagesAllStickersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetAllStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesAllStickersBox{AllStickers: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetAllStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetWebPagePreview(f func(ctx context.Context, request *MessagesGetWebPagePreviewRequest) (MessageMediaClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetWebPagePreviewRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessageMediaBox{MessageMedia: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetWebPagePreviewRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesExportChatInvite(f func(ctx context.Context, request *MessagesExportChatInviteRequest) (*ChatInviteExported, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesExportChatInviteRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesExportChatInviteRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesCheckChatInvite(f func(ctx context.Context, hash string) (ChatInviteClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesCheckChatInviteRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &ChatInviteBox{ChatInvite: response}, nil |
|
} |
|
|
|
s.handlers[MessagesCheckChatInviteRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesImportChatInvite(f func(ctx context.Context, hash string) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesImportChatInviteRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesImportChatInviteRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetStickerSet(f func(ctx context.Context, request *MessagesGetStickerSetRequest) (MessagesStickerSetClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetStickerSetRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesStickerSetBox{StickerSet: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetStickerSetRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesInstallStickerSet(f func(ctx context.Context, request *MessagesInstallStickerSetRequest) (MessagesStickerSetInstallResultClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesInstallStickerSetRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesStickerSetInstallResultBox{StickerSetInstallResult: response}, nil |
|
} |
|
|
|
s.handlers[MessagesInstallStickerSetRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesUninstallStickerSet(f func(ctx context.Context, stickerset InputStickerSetClass) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesUninstallStickerSetRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Stickerset) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesUninstallStickerSetRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesStartBot(f func(ctx context.Context, request *MessagesStartBotRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesStartBotRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesStartBotRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetMessagesViews(f func(ctx context.Context, request *MessagesGetMessagesViewsRequest) (*MessagesMessageViews, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetMessagesViewsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetMessagesViewsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesEditChatAdmin(f func(ctx context.Context, request *MessagesEditChatAdminRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesEditChatAdminRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesEditChatAdminRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesMigrateChat(f func(ctx context.Context, chatid int64) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesMigrateChatRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ChatID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesMigrateChatRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSearchGlobal(f func(ctx context.Context, request *MessagesSearchGlobalRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSearchGlobalRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSearchGlobalRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReorderStickerSets(f func(ctx context.Context, request *MessagesReorderStickerSetsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReorderStickerSetsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesReorderStickerSetsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetDocumentByHash(f func(ctx context.Context, request *MessagesGetDocumentByHashRequest) (DocumentClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetDocumentByHashRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &DocumentBox{Document: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetDocumentByHashRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetSavedGifs(f func(ctx context.Context, hash int64) (MessagesSavedGifsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetSavedGifsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesSavedGifsBox{SavedGifs: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetSavedGifsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSaveGif(f func(ctx context.Context, request *MessagesSaveGifRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSaveGifRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSaveGifRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetInlineBotResults(f func(ctx context.Context, request *MessagesGetInlineBotResultsRequest) (*MessagesBotResults, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetInlineBotResultsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetInlineBotResultsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetInlineBotResults(f func(ctx context.Context, request *MessagesSetInlineBotResultsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetInlineBotResultsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSetInlineBotResultsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendInlineBotResult(f func(ctx context.Context, request *MessagesSendInlineBotResultRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendInlineBotResultRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendInlineBotResultRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetMessageEditData(f func(ctx context.Context, request *MessagesGetMessageEditDataRequest) (*MessagesMessageEditData, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetMessageEditDataRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetMessageEditDataRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesEditMessage(f func(ctx context.Context, request *MessagesEditMessageRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesEditMessageRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesEditMessageRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesEditInlineBotMessage(f func(ctx context.Context, request *MessagesEditInlineBotMessageRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesEditInlineBotMessageRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesEditInlineBotMessageRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetBotCallbackAnswer(f func(ctx context.Context, request *MessagesGetBotCallbackAnswerRequest) (*MessagesBotCallbackAnswer, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetBotCallbackAnswerRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetBotCallbackAnswerRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetBotCallbackAnswer(f func(ctx context.Context, request *MessagesSetBotCallbackAnswerRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetBotCallbackAnswerRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSetBotCallbackAnswerRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetPeerDialogs(f func(ctx context.Context, peers []InputDialogPeerClass) (*MessagesPeerDialogs, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetPeerDialogsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peers) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetPeerDialogsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSaveDraft(f func(ctx context.Context, request *MessagesSaveDraftRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSaveDraftRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSaveDraftRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetAllDrafts(f func(ctx context.Context) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetAllDraftsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetAllDraftsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetFeaturedStickers(f func(ctx context.Context, hash int64) (MessagesFeaturedStickersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetFeaturedStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesFeaturedStickersBox{FeaturedStickers: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetFeaturedStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReadFeaturedStickers(f func(ctx context.Context, id []int64) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReadFeaturedStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesReadFeaturedStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetRecentStickers(f func(ctx context.Context, request *MessagesGetRecentStickersRequest) (MessagesRecentStickersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetRecentStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesRecentStickersBox{RecentStickers: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetRecentStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSaveRecentSticker(f func(ctx context.Context, request *MessagesSaveRecentStickerRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSaveRecentStickerRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSaveRecentStickerRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesClearRecentStickers(f func(ctx context.Context, request *MessagesClearRecentStickersRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesClearRecentStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesClearRecentStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetArchivedStickers(f func(ctx context.Context, request *MessagesGetArchivedStickersRequest) (*MessagesArchivedStickers, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetArchivedStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetArchivedStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetMaskStickers(f func(ctx context.Context, hash int64) (MessagesAllStickersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetMaskStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesAllStickersBox{AllStickers: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetMaskStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetAttachedStickers(f func(ctx context.Context, media InputStickeredMediaClass) ([]StickerSetCoveredClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetAttachedStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Media) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &StickerSetCoveredClassVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetAttachedStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetGameScore(f func(ctx context.Context, request *MessagesSetGameScoreRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetGameScoreRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSetGameScoreRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetInlineGameScore(f func(ctx context.Context, request *MessagesSetInlineGameScoreRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetInlineGameScoreRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSetInlineGameScoreRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetGameHighScores(f func(ctx context.Context, request *MessagesGetGameHighScoresRequest) (*MessagesHighScores, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetGameHighScoresRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetGameHighScoresRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetInlineGameHighScores(f func(ctx context.Context, request *MessagesGetInlineGameHighScoresRequest) (*MessagesHighScores, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetInlineGameHighScoresRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetInlineGameHighScoresRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetCommonChats(f func(ctx context.Context, request *MessagesGetCommonChatsRequest) (MessagesChatsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetCommonChatsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesChatsBox{Chats: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetCommonChatsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetAllChats(f func(ctx context.Context, exceptids []int64) (MessagesChatsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetAllChatsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ExceptIDs) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesChatsBox{Chats: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetAllChatsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetWebPage(f func(ctx context.Context, request *MessagesGetWebPageRequest) (WebPageClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetWebPageRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &WebPageBox{WebPage: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetWebPageRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesToggleDialogPin(f func(ctx context.Context, request *MessagesToggleDialogPinRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesToggleDialogPinRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesToggleDialogPinRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReorderPinnedDialogs(f func(ctx context.Context, request *MessagesReorderPinnedDialogsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReorderPinnedDialogsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesReorderPinnedDialogsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetPinnedDialogs(f func(ctx context.Context, folderid int) (*MessagesPeerDialogs, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetPinnedDialogsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.FolderID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetPinnedDialogsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetBotShippingResults(f func(ctx context.Context, request *MessagesSetBotShippingResultsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetBotShippingResultsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSetBotShippingResultsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetBotPrecheckoutResults(f func(ctx context.Context, request *MessagesSetBotPrecheckoutResultsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetBotPrecheckoutResultsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSetBotPrecheckoutResultsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesUploadMedia(f func(ctx context.Context, request *MessagesUploadMediaRequest) (MessageMediaClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesUploadMediaRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessageMediaBox{MessageMedia: response}, nil |
|
} |
|
|
|
s.handlers[MessagesUploadMediaRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendScreenshotNotification(f func(ctx context.Context, request *MessagesSendScreenshotNotificationRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendScreenshotNotificationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendScreenshotNotificationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetFavedStickers(f func(ctx context.Context, hash int64) (MessagesFavedStickersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetFavedStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesFavedStickersBox{FavedStickers: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetFavedStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesFaveSticker(f func(ctx context.Context, request *MessagesFaveStickerRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesFaveStickerRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesFaveStickerRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetUnreadMentions(f func(ctx context.Context, request *MessagesGetUnreadMentionsRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetUnreadMentionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetUnreadMentionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReadMentions(f func(ctx context.Context, peer InputPeerClass) (*MessagesAffectedHistory, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReadMentionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesReadMentionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetRecentLocations(f func(ctx context.Context, request *MessagesGetRecentLocationsRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetRecentLocationsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetRecentLocationsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendMultiMedia(f func(ctx context.Context, request *MessagesSendMultiMediaRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendMultiMediaRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendMultiMediaRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesUploadEncryptedFile(f func(ctx context.Context, request *MessagesUploadEncryptedFileRequest) (EncryptedFileClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesUploadEncryptedFileRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &EncryptedFileBox{EncryptedFile: response}, nil |
|
} |
|
|
|
s.handlers[MessagesUploadEncryptedFileRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSearchStickerSets(f func(ctx context.Context, request *MessagesSearchStickerSetsRequest) (MessagesFoundStickerSetsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSearchStickerSetsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesFoundStickerSetsBox{FoundStickerSets: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSearchStickerSetsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetSplitRanges(f func(ctx context.Context) ([]MessageRange, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetSplitRangesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessageRangeVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetSplitRangesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesMarkDialogUnread(f func(ctx context.Context, request *MessagesMarkDialogUnreadRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesMarkDialogUnreadRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesMarkDialogUnreadRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetDialogUnreadMarks(f func(ctx context.Context) ([]DialogPeerClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetDialogUnreadMarksRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &DialogPeerClassVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetDialogUnreadMarksRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesClearAllDrafts(f func(ctx context.Context) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesClearAllDraftsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesClearAllDraftsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesUpdatePinnedMessage(f func(ctx context.Context, request *MessagesUpdatePinnedMessageRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesUpdatePinnedMessageRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesUpdatePinnedMessageRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendVote(f func(ctx context.Context, request *MessagesSendVoteRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendVoteRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendVoteRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetPollResults(f func(ctx context.Context, request *MessagesGetPollResultsRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetPollResultsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetPollResultsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetOnlines(f func(ctx context.Context, peer InputPeerClass) (*ChatOnlines, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetOnlinesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetOnlinesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesEditChatAbout(f func(ctx context.Context, request *MessagesEditChatAboutRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesEditChatAboutRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesEditChatAboutRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesEditChatDefaultBannedRights(f func(ctx context.Context, request *MessagesEditChatDefaultBannedRightsRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesEditChatDefaultBannedRightsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesEditChatDefaultBannedRightsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetEmojiKeywords(f func(ctx context.Context, langcode string) (*EmojiKeywordsDifference, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetEmojiKeywordsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.LangCode) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetEmojiKeywordsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetEmojiKeywordsDifference(f func(ctx context.Context, request *MessagesGetEmojiKeywordsDifferenceRequest) (*EmojiKeywordsDifference, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetEmojiKeywordsDifferenceRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetEmojiKeywordsDifferenceRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetEmojiKeywordsLanguages(f func(ctx context.Context, langcodes []string) ([]EmojiLanguage, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetEmojiKeywordsLanguagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.LangCodes) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &EmojiLanguageVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetEmojiKeywordsLanguagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetEmojiURL(f func(ctx context.Context, langcode string) (*EmojiURL, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetEmojiURLRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.LangCode) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetEmojiURLRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetSearchCounters(f func(ctx context.Context, request *MessagesGetSearchCountersRequest) ([]MessagesSearchCounter, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetSearchCountersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesSearchCounterVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetSearchCountersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesRequestURLAuth(f func(ctx context.Context, request *MessagesRequestURLAuthRequest) (URLAuthResultClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesRequestURLAuthRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &URLAuthResultBox{UrlAuthResult: response}, nil |
|
} |
|
|
|
s.handlers[MessagesRequestURLAuthRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesAcceptURLAuth(f func(ctx context.Context, request *MessagesAcceptURLAuthRequest) (URLAuthResultClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesAcceptURLAuthRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &URLAuthResultBox{UrlAuthResult: response}, nil |
|
} |
|
|
|
s.handlers[MessagesAcceptURLAuthRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesHidePeerSettingsBar(f func(ctx context.Context, peer InputPeerClass) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesHidePeerSettingsBarRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesHidePeerSettingsBarRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetScheduledHistory(f func(ctx context.Context, request *MessagesGetScheduledHistoryRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetScheduledHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetScheduledHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetScheduledMessages(f func(ctx context.Context, request *MessagesGetScheduledMessagesRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetScheduledMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetScheduledMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendScheduledMessages(f func(ctx context.Context, request *MessagesSendScheduledMessagesRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendScheduledMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendScheduledMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDeleteScheduledMessages(f func(ctx context.Context, request *MessagesDeleteScheduledMessagesRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDeleteScheduledMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesDeleteScheduledMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetPollVotes(f func(ctx context.Context, request *MessagesGetPollVotesRequest) (*MessagesVotesList, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetPollVotesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetPollVotesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesToggleStickerSets(f func(ctx context.Context, request *MessagesToggleStickerSetsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesToggleStickerSetsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesToggleStickerSetsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetDialogFilters(f func(ctx context.Context) ([]DialogFilter, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetDialogFiltersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &DialogFilterVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetDialogFiltersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetSuggestedDialogFilters(f func(ctx context.Context) ([]DialogFilterSuggested, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetSuggestedDialogFiltersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &DialogFilterSuggestedVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetSuggestedDialogFiltersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesUpdateDialogFilter(f func(ctx context.Context, request *MessagesUpdateDialogFilterRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesUpdateDialogFilterRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesUpdateDialogFilterRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesUpdateDialogFiltersOrder(f func(ctx context.Context, order []int) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesUpdateDialogFiltersOrderRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Order) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesUpdateDialogFiltersOrderRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetOldFeaturedStickers(f func(ctx context.Context, request *MessagesGetOldFeaturedStickersRequest) (MessagesFeaturedStickersClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetOldFeaturedStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesFeaturedStickersBox{FeaturedStickers: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetOldFeaturedStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetReplies(f func(ctx context.Context, request *MessagesGetRepliesRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetRepliesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetRepliesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetDiscussionMessage(f func(ctx context.Context, request *MessagesGetDiscussionMessageRequest) (*MessagesDiscussionMessage, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetDiscussionMessageRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetDiscussionMessageRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReadDiscussion(f func(ctx context.Context, request *MessagesReadDiscussionRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReadDiscussionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesReadDiscussionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesUnpinAllMessages(f func(ctx context.Context, peer InputPeerClass) (*MessagesAffectedHistory, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesUnpinAllMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesUnpinAllMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDeleteChat(f func(ctx context.Context, chatid int64) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDeleteChatRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ChatID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesDeleteChatRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDeletePhoneCallHistory(f func(ctx context.Context, request *MessagesDeletePhoneCallHistoryRequest) (*MessagesAffectedFoundMessages, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDeletePhoneCallHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesDeletePhoneCallHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesCheckHistoryImport(f func(ctx context.Context, importhead string) (*MessagesHistoryImportParsed, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesCheckHistoryImportRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ImportHead) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesCheckHistoryImportRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesInitHistoryImport(f func(ctx context.Context, request *MessagesInitHistoryImportRequest) (*MessagesHistoryImport, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesInitHistoryImportRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesInitHistoryImportRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesUploadImportedMedia(f func(ctx context.Context, request *MessagesUploadImportedMediaRequest) (MessageMediaClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesUploadImportedMediaRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessageMediaBox{MessageMedia: response}, nil |
|
} |
|
|
|
s.handlers[MessagesUploadImportedMediaRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesStartHistoryImport(f func(ctx context.Context, request *MessagesStartHistoryImportRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesStartHistoryImportRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesStartHistoryImportRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetExportedChatInvites(f func(ctx context.Context, request *MessagesGetExportedChatInvitesRequest) (*MessagesExportedChatInvites, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetExportedChatInvitesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetExportedChatInvitesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetExportedChatInvite(f func(ctx context.Context, request *MessagesGetExportedChatInviteRequest) (MessagesExportedChatInviteClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetExportedChatInviteRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesExportedChatInviteBox{ExportedChatInvite: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetExportedChatInviteRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesEditExportedChatInvite(f func(ctx context.Context, request *MessagesEditExportedChatInviteRequest) (MessagesExportedChatInviteClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesEditExportedChatInviteRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesExportedChatInviteBox{ExportedChatInvite: response}, nil |
|
} |
|
|
|
s.handlers[MessagesEditExportedChatInviteRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDeleteRevokedExportedChatInvites(f func(ctx context.Context, request *MessagesDeleteRevokedExportedChatInvitesRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDeleteRevokedExportedChatInvitesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesDeleteRevokedExportedChatInvitesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesDeleteExportedChatInvite(f func(ctx context.Context, request *MessagesDeleteExportedChatInviteRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesDeleteExportedChatInviteRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesDeleteExportedChatInviteRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetAdminsWithInvites(f func(ctx context.Context, peer InputPeerClass) (*MessagesChatAdminsWithInvites, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetAdminsWithInvitesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetAdminsWithInvitesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetChatInviteImporters(f func(ctx context.Context, request *MessagesGetChatInviteImportersRequest) (*MessagesChatInviteImporters, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetChatInviteImportersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetChatInviteImportersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetHistoryTTL(f func(ctx context.Context, request *MessagesSetHistoryTTLRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetHistoryTTLRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSetHistoryTTLRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesCheckHistoryImportPeer(f func(ctx context.Context, peer InputPeerClass) (*MessagesCheckedHistoryImportPeer, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesCheckHistoryImportPeerRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesCheckHistoryImportPeerRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetChatTheme(f func(ctx context.Context, request *MessagesSetChatThemeRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetChatThemeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSetChatThemeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetMessageReadParticipants(f func(ctx context.Context, request *MessagesGetMessageReadParticipantsRequest) ([]int64, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetMessageReadParticipantsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &LongVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetMessageReadParticipantsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetSearchResultsCalendar(f func(ctx context.Context, request *MessagesGetSearchResultsCalendarRequest) (*MessagesSearchResultsCalendar, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetSearchResultsCalendarRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetSearchResultsCalendarRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetSearchResultsPositions(f func(ctx context.Context, request *MessagesGetSearchResultsPositionsRequest) (*MessagesSearchResultsPositions, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetSearchResultsPositionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetSearchResultsPositionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesHideChatJoinRequest(f func(ctx context.Context, request *MessagesHideChatJoinRequestRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesHideChatJoinRequestRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesHideChatJoinRequestRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesHideAllChatJoinRequests(f func(ctx context.Context, request *MessagesHideAllChatJoinRequestsRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesHideAllChatJoinRequestsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesHideAllChatJoinRequestsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesToggleNoForwards(f func(ctx context.Context, request *MessagesToggleNoForwardsRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesToggleNoForwardsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesToggleNoForwardsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSaveDefaultSendAs(f func(ctx context.Context, request *MessagesSaveDefaultSendAsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSaveDefaultSendAsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSaveDefaultSendAsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSendReaction(f func(ctx context.Context, request *MessagesSendReactionRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSendReactionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSendReactionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetMessagesReactions(f func(ctx context.Context, request *MessagesGetMessagesReactionsRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetMessagesReactionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetMessagesReactionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetMessageReactionsList(f func(ctx context.Context, request *MessagesGetMessageReactionsListRequest) (*MessagesMessageReactionsList, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetMessageReactionsListRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesGetMessageReactionsListRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetChatAvailableReactions(f func(ctx context.Context, request *MessagesSetChatAvailableReactionsRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetChatAvailableReactionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSetChatAvailableReactionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetAvailableReactions(f func(ctx context.Context, hash int) (MessagesAvailableReactionsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetAvailableReactionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesAvailableReactionsBox{AvailableReactions: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetAvailableReactionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSetDefaultReaction(f func(ctx context.Context, reaction string) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSetDefaultReactionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Reaction) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[MessagesSetDefaultReactionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesTranslateText(f func(ctx context.Context, request *MessagesTranslateTextRequest) (MessagesTranslatedTextClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesTranslateTextRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesTranslatedTextBox{TranslatedText: response}, nil |
|
} |
|
|
|
s.handlers[MessagesTranslateTextRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesGetUnreadReactions(f func(ctx context.Context, request *MessagesGetUnreadReactionsRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesGetUnreadReactionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesGetUnreadReactionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesReadReactions(f func(ctx context.Context, peer InputPeerClass) (*MessagesAffectedHistory, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesReadReactionsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[MessagesReadReactionsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnMessagesSearchSentMedia(f func(ctx context.Context, request *MessagesSearchSentMediaRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request MessagesSearchSentMediaRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[MessagesSearchSentMediaRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUpdatesGetState(f func(ctx context.Context) (*UpdatesState, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UpdatesGetStateRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[UpdatesGetStateRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUpdatesGetDifference(f func(ctx context.Context, request *UpdatesGetDifferenceRequest) (UpdatesDifferenceClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UpdatesGetDifferenceRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesDifferenceBox{Difference: response}, nil |
|
} |
|
|
|
s.handlers[UpdatesGetDifferenceRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUpdatesGetChannelDifference(f func(ctx context.Context, request *UpdatesGetChannelDifferenceRequest) (UpdatesChannelDifferenceClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UpdatesGetChannelDifferenceRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesChannelDifferenceBox{ChannelDifference: response}, nil |
|
} |
|
|
|
s.handlers[UpdatesGetChannelDifferenceRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhotosUpdateProfilePhoto(f func(ctx context.Context, id InputPhotoClass) (*PhotosPhoto, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhotosUpdateProfilePhotoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhotosUpdateProfilePhotoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhotosUploadProfilePhoto(f func(ctx context.Context, request *PhotosUploadProfilePhotoRequest) (*PhotosPhoto, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhotosUploadProfilePhotoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhotosUploadProfilePhotoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhotosDeletePhotos(f func(ctx context.Context, id []InputPhotoClass) ([]int64, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhotosDeletePhotosRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &LongVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[PhotosDeletePhotosRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhotosGetUserPhotos(f func(ctx context.Context, request *PhotosGetUserPhotosRequest) (PhotosPhotosClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhotosGetUserPhotosRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &PhotosPhotosBox{Photos: response}, nil |
|
} |
|
|
|
s.handlers[PhotosGetUserPhotosRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUploadSaveFilePart(f func(ctx context.Context, request *UploadSaveFilePartRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UploadSaveFilePartRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[UploadSaveFilePartRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUploadGetFile(f func(ctx context.Context, request *UploadGetFileRequest) (UploadFileClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UploadGetFileRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UploadFileBox{File: response}, nil |
|
} |
|
|
|
s.handlers[UploadGetFileRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUploadSaveBigFilePart(f func(ctx context.Context, request *UploadSaveBigFilePartRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UploadSaveBigFilePartRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[UploadSaveBigFilePartRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUploadGetWebFile(f func(ctx context.Context, request *UploadGetWebFileRequest) (*UploadWebFile, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UploadGetWebFileRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[UploadGetWebFileRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUploadGetCDNFile(f func(ctx context.Context, request *UploadGetCDNFileRequest) (UploadCDNFileClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UploadGetCDNFileRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UploadCDNFileBox{CdnFile: response}, nil |
|
} |
|
|
|
s.handlers[UploadGetCDNFileRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUploadReuploadCDNFile(f func(ctx context.Context, request *UploadReuploadCDNFileRequest) ([]FileHash, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UploadReuploadCDNFileRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &FileHashVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[UploadReuploadCDNFileRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUploadGetCDNFileHashes(f func(ctx context.Context, request *UploadGetCDNFileHashesRequest) ([]FileHash, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UploadGetCDNFileHashesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &FileHashVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[UploadGetCDNFileHashesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnUploadGetFileHashes(f func(ctx context.Context, request *UploadGetFileHashesRequest) ([]FileHash, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request UploadGetFileHashesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &FileHashVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[UploadGetFileHashesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetConfig(f func(ctx context.Context) (*Config, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetConfigRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[HelpGetConfigRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetNearestDC(f func(ctx context.Context) (*NearestDC, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetNearestDCRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[HelpGetNearestDCRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetAppUpdate(f func(ctx context.Context, source string) (HelpAppUpdateClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetAppUpdateRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Source) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &HelpAppUpdateBox{AppUpdate: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetAppUpdateRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetInviteText(f func(ctx context.Context) (*HelpInviteText, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetInviteTextRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[HelpGetInviteTextRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetSupport(f func(ctx context.Context) (*HelpSupport, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetSupportRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[HelpGetSupportRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetAppChangelog(f func(ctx context.Context, prevappversion string) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetAppChangelogRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.PrevAppVersion) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetAppChangelogRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpSetBotUpdatesStatus(f func(ctx context.Context, request *HelpSetBotUpdatesStatusRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpSetBotUpdatesStatusRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[HelpSetBotUpdatesStatusRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetCDNConfig(f func(ctx context.Context) (*CDNConfig, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetCDNConfigRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[HelpGetCDNConfigRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetRecentMeURLs(f func(ctx context.Context, referer string) (*HelpRecentMeURLs, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetRecentMeURLsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Referer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[HelpGetRecentMeURLsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetTermsOfServiceUpdate(f func(ctx context.Context) (HelpTermsOfServiceUpdateClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetTermsOfServiceUpdateRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &HelpTermsOfServiceUpdateBox{TermsOfServiceUpdate: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetTermsOfServiceUpdateRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpAcceptTermsOfService(f func(ctx context.Context, id DataJSON) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpAcceptTermsOfServiceRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[HelpAcceptTermsOfServiceRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetDeepLinkInfo(f func(ctx context.Context, path string) (HelpDeepLinkInfoClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetDeepLinkInfoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Path) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &HelpDeepLinkInfoBox{DeepLinkInfo: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetDeepLinkInfoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetAppConfig(f func(ctx context.Context) (JSONValueClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetAppConfigRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &JSONValueBox{JSONValue: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetAppConfigRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpSaveAppLog(f func(ctx context.Context, events []InputAppEvent) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpSaveAppLogRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Events) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[HelpSaveAppLogRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetPassportConfig(f func(ctx context.Context, hash int) (HelpPassportConfigClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetPassportConfigRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Hash) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &HelpPassportConfigBox{PassportConfig: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetPassportConfigRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetSupportName(f func(ctx context.Context) (*HelpSupportName, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetSupportNameRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[HelpGetSupportNameRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetUserInfo(f func(ctx context.Context, userid InputUserClass) (HelpUserInfoClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetUserInfoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.UserID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &HelpUserInfoBox{UserInfo: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetUserInfoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpEditUserInfo(f func(ctx context.Context, request *HelpEditUserInfoRequest) (HelpUserInfoClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpEditUserInfoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &HelpUserInfoBox{UserInfo: response}, nil |
|
} |
|
|
|
s.handlers[HelpEditUserInfoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetPromoData(f func(ctx context.Context) (HelpPromoDataClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetPromoDataRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &HelpPromoDataBox{PromoData: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetPromoDataRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpHidePromoData(f func(ctx context.Context, peer InputPeerClass) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpHidePromoDataRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[HelpHidePromoDataRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpDismissSuggestion(f func(ctx context.Context, request *HelpDismissSuggestionRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpDismissSuggestionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[HelpDismissSuggestionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnHelpGetCountriesList(f func(ctx context.Context, request *HelpGetCountriesListRequest) (HelpCountriesListClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request HelpGetCountriesListRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &HelpCountriesListBox{CountriesList: response}, nil |
|
} |
|
|
|
s.handlers[HelpGetCountriesListRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsReadHistory(f func(ctx context.Context, request *ChannelsReadHistoryRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsReadHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsReadHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsDeleteMessages(f func(ctx context.Context, request *ChannelsDeleteMessagesRequest) (*MessagesAffectedMessages, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsDeleteMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsDeleteMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsReportSpam(f func(ctx context.Context, request *ChannelsReportSpamRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsReportSpamRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsReportSpamRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetMessages(f func(ctx context.Context, request *ChannelsGetMessagesRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsGetMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetParticipants(f func(ctx context.Context, request *ChannelsGetParticipantsRequest) (ChannelsChannelParticipantsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetParticipantsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &ChannelsChannelParticipantsBox{ChannelParticipants: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsGetParticipantsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetParticipant(f func(ctx context.Context, request *ChannelsGetParticipantRequest) (*ChannelsChannelParticipant, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetParticipantRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsGetParticipantRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetChannels(f func(ctx context.Context, id []InputChannelClass) (MessagesChatsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetChannelsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesChatsBox{Chats: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsGetChannelsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetFullChannel(f func(ctx context.Context, channel InputChannelClass) (*MessagesChatFull, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetFullChannelRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Channel) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsGetFullChannelRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsCreateChannel(f func(ctx context.Context, request *ChannelsCreateChannelRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsCreateChannelRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsCreateChannelRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsEditAdmin(f func(ctx context.Context, request *ChannelsEditAdminRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsEditAdminRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsEditAdminRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsEditTitle(f func(ctx context.Context, request *ChannelsEditTitleRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsEditTitleRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsEditTitleRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsEditPhoto(f func(ctx context.Context, request *ChannelsEditPhotoRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsEditPhotoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsEditPhotoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsCheckUsername(f func(ctx context.Context, request *ChannelsCheckUsernameRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsCheckUsernameRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsCheckUsernameRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsUpdateUsername(f func(ctx context.Context, request *ChannelsUpdateUsernameRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsUpdateUsernameRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsUpdateUsernameRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsJoinChannel(f func(ctx context.Context, channel InputChannelClass) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsJoinChannelRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Channel) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsJoinChannelRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsLeaveChannel(f func(ctx context.Context, channel InputChannelClass) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsLeaveChannelRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Channel) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsLeaveChannelRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsInviteToChannel(f func(ctx context.Context, request *ChannelsInviteToChannelRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsInviteToChannelRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsInviteToChannelRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsDeleteChannel(f func(ctx context.Context, channel InputChannelClass) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsDeleteChannelRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Channel) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsDeleteChannelRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsExportMessageLink(f func(ctx context.Context, request *ChannelsExportMessageLinkRequest) (*ExportedMessageLink, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsExportMessageLinkRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsExportMessageLinkRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsToggleSignatures(f func(ctx context.Context, request *ChannelsToggleSignaturesRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsToggleSignaturesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsToggleSignaturesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetAdminedPublicChannels(f func(ctx context.Context, request *ChannelsGetAdminedPublicChannelsRequest) (MessagesChatsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetAdminedPublicChannelsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesChatsBox{Chats: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsGetAdminedPublicChannelsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsEditBanned(f func(ctx context.Context, request *ChannelsEditBannedRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsEditBannedRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsEditBannedRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetAdminLog(f func(ctx context.Context, request *ChannelsGetAdminLogRequest) (*ChannelsAdminLogResults, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetAdminLogRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsGetAdminLogRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsSetStickers(f func(ctx context.Context, request *ChannelsSetStickersRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsSetStickersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsSetStickersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsReadMessageContents(f func(ctx context.Context, request *ChannelsReadMessageContentsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsReadMessageContentsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsReadMessageContentsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsDeleteHistory(f func(ctx context.Context, request *ChannelsDeleteHistoryRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsDeleteHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsDeleteHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsTogglePreHistoryHidden(f func(ctx context.Context, request *ChannelsTogglePreHistoryHiddenRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsTogglePreHistoryHiddenRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsTogglePreHistoryHiddenRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetLeftChannels(f func(ctx context.Context, offset int) (MessagesChatsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetLeftChannelsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Offset) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesChatsBox{Chats: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsGetLeftChannelsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetGroupsForDiscussion(f func(ctx context.Context) (MessagesChatsClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetGroupsForDiscussionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesChatsBox{Chats: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsGetGroupsForDiscussionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsSetDiscussionGroup(f func(ctx context.Context, request *ChannelsSetDiscussionGroupRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsSetDiscussionGroupRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsSetDiscussionGroupRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsEditCreator(f func(ctx context.Context, request *ChannelsEditCreatorRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsEditCreatorRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsEditCreatorRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsEditLocation(f func(ctx context.Context, request *ChannelsEditLocationRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsEditLocationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsEditLocationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsToggleSlowMode(f func(ctx context.Context, request *ChannelsToggleSlowModeRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsToggleSlowModeRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsToggleSlowModeRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetInactiveChannels(f func(ctx context.Context) (*MessagesInactiveChats, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetInactiveChannelsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsGetInactiveChannelsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsConvertToGigagroup(f func(ctx context.Context, channel InputChannelClass) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsConvertToGigagroupRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Channel) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[ChannelsConvertToGigagroupRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsViewSponsoredMessage(f func(ctx context.Context, request *ChannelsViewSponsoredMessageRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsViewSponsoredMessageRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[ChannelsViewSponsoredMessageRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetSponsoredMessages(f func(ctx context.Context, channel InputChannelClass) (*MessagesSponsoredMessages, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetSponsoredMessagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Channel) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsGetSponsoredMessagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsGetSendAs(f func(ctx context.Context, peer InputPeerClass) (*ChannelsSendAsPeers, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsGetSendAsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsGetSendAsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnChannelsDeleteParticipantHistory(f func(ctx context.Context, request *ChannelsDeleteParticipantHistoryRequest) (*MessagesAffectedHistory, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request ChannelsDeleteParticipantHistoryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[ChannelsDeleteParticipantHistoryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnBotsSendCustomRequest(f func(ctx context.Context, request *BotsSendCustomRequestRequest) (*DataJSON, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request BotsSendCustomRequestRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[BotsSendCustomRequestRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnBotsAnswerWebhookJSONQuery(f func(ctx context.Context, request *BotsAnswerWebhookJSONQueryRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request BotsAnswerWebhookJSONQueryRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[BotsAnswerWebhookJSONQueryRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnBotsSetBotCommands(f func(ctx context.Context, request *BotsSetBotCommandsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request BotsSetBotCommandsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[BotsSetBotCommandsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnBotsResetBotCommands(f func(ctx context.Context, request *BotsResetBotCommandsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request BotsResetBotCommandsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[BotsResetBotCommandsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnBotsGetBotCommands(f func(ctx context.Context, request *BotsGetBotCommandsRequest) ([]BotCommand, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request BotsGetBotCommandsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &BotCommandVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[BotsGetBotCommandsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPaymentsGetPaymentForm(f func(ctx context.Context, request *PaymentsGetPaymentFormRequest) (*PaymentsPaymentForm, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PaymentsGetPaymentFormRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PaymentsGetPaymentFormRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPaymentsGetPaymentReceipt(f func(ctx context.Context, request *PaymentsGetPaymentReceiptRequest) (*PaymentsPaymentReceipt, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PaymentsGetPaymentReceiptRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PaymentsGetPaymentReceiptRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPaymentsValidateRequestedInfo(f func(ctx context.Context, request *PaymentsValidateRequestedInfoRequest) (*PaymentsValidatedRequestedInfo, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PaymentsValidateRequestedInfoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PaymentsValidateRequestedInfoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPaymentsSendPaymentForm(f func(ctx context.Context, request *PaymentsSendPaymentFormRequest) (PaymentsPaymentResultClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PaymentsSendPaymentFormRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &PaymentsPaymentResultBox{PaymentResult: response}, nil |
|
} |
|
|
|
s.handlers[PaymentsSendPaymentFormRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPaymentsGetSavedInfo(f func(ctx context.Context) (*PaymentsSavedInfo, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PaymentsGetSavedInfoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PaymentsGetSavedInfoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPaymentsClearSavedInfo(f func(ctx context.Context, request *PaymentsClearSavedInfoRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PaymentsClearSavedInfoRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[PaymentsClearSavedInfoRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPaymentsGetBankCardData(f func(ctx context.Context, number string) (*PaymentsBankCardData, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PaymentsGetBankCardDataRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Number) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PaymentsGetBankCardDataRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStickersCreateStickerSet(f func(ctx context.Context, request *StickersCreateStickerSetRequest) (MessagesStickerSetClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StickersCreateStickerSetRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesStickerSetBox{StickerSet: response}, nil |
|
} |
|
|
|
s.handlers[StickersCreateStickerSetRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStickersRemoveStickerFromSet(f func(ctx context.Context, sticker InputDocumentClass) (MessagesStickerSetClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StickersRemoveStickerFromSetRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Sticker) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesStickerSetBox{StickerSet: response}, nil |
|
} |
|
|
|
s.handlers[StickersRemoveStickerFromSetRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStickersChangeStickerPosition(f func(ctx context.Context, request *StickersChangeStickerPositionRequest) (MessagesStickerSetClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StickersChangeStickerPositionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesStickerSetBox{StickerSet: response}, nil |
|
} |
|
|
|
s.handlers[StickersChangeStickerPositionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStickersAddStickerToSet(f func(ctx context.Context, request *StickersAddStickerToSetRequest) (MessagesStickerSetClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StickersAddStickerToSetRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesStickerSetBox{StickerSet: response}, nil |
|
} |
|
|
|
s.handlers[StickersAddStickerToSetRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStickersSetStickerSetThumb(f func(ctx context.Context, request *StickersSetStickerSetThumbRequest) (MessagesStickerSetClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StickersSetStickerSetThumbRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesStickerSetBox{StickerSet: response}, nil |
|
} |
|
|
|
s.handlers[StickersSetStickerSetThumbRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStickersCheckShortName(f func(ctx context.Context, shortname string) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StickersCheckShortNameRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.ShortName) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[StickersCheckShortNameRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStickersSuggestShortName(f func(ctx context.Context, title string) (*StickersSuggestedShortName, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StickersSuggestShortNameRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Title) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[StickersSuggestShortNameRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneGetCallConfig(f func(ctx context.Context) (*DataJSON, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneGetCallConfigRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneGetCallConfigRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneRequestCall(f func(ctx context.Context, request *PhoneRequestCallRequest) (*PhonePhoneCall, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneRequestCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneRequestCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneAcceptCall(f func(ctx context.Context, request *PhoneAcceptCallRequest) (*PhonePhoneCall, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneAcceptCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneAcceptCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneConfirmCall(f func(ctx context.Context, request *PhoneConfirmCallRequest) (*PhonePhoneCall, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneConfirmCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneConfirmCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneReceivedCall(f func(ctx context.Context, peer InputPhoneCall) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneReceivedCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[PhoneReceivedCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneDiscardCall(f func(ctx context.Context, request *PhoneDiscardCallRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneDiscardCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneDiscardCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneSetCallRating(f func(ctx context.Context, request *PhoneSetCallRatingRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneSetCallRatingRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneSetCallRatingRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneSaveCallDebug(f func(ctx context.Context, request *PhoneSaveCallDebugRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneSaveCallDebugRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[PhoneSaveCallDebugRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneSendSignalingData(f func(ctx context.Context, request *PhoneSendSignalingDataRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneSendSignalingDataRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[PhoneSendSignalingDataRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneCreateGroupCall(f func(ctx context.Context, request *PhoneCreateGroupCallRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneCreateGroupCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneCreateGroupCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneJoinGroupCall(f func(ctx context.Context, request *PhoneJoinGroupCallRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneJoinGroupCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneJoinGroupCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneLeaveGroupCall(f func(ctx context.Context, request *PhoneLeaveGroupCallRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneLeaveGroupCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneLeaveGroupCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneInviteToGroupCall(f func(ctx context.Context, request *PhoneInviteToGroupCallRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneInviteToGroupCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneInviteToGroupCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneDiscardGroupCall(f func(ctx context.Context, call InputGroupCall) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneDiscardGroupCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Call) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneDiscardGroupCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneToggleGroupCallSettings(f func(ctx context.Context, request *PhoneToggleGroupCallSettingsRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneToggleGroupCallSettingsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneToggleGroupCallSettingsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneGetGroupCall(f func(ctx context.Context, request *PhoneGetGroupCallRequest) (*PhoneGroupCall, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneGetGroupCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneGetGroupCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneGetGroupParticipants(f func(ctx context.Context, request *PhoneGetGroupParticipantsRequest) (*PhoneGroupParticipants, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneGetGroupParticipantsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneGetGroupParticipantsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneCheckGroupCall(f func(ctx context.Context, request *PhoneCheckGroupCallRequest) ([]int, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneCheckGroupCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &IntVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[PhoneCheckGroupCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneToggleGroupCallRecord(f func(ctx context.Context, request *PhoneToggleGroupCallRecordRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneToggleGroupCallRecordRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneToggleGroupCallRecordRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneEditGroupCallParticipant(f func(ctx context.Context, request *PhoneEditGroupCallParticipantRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneEditGroupCallParticipantRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneEditGroupCallParticipantRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneEditGroupCallTitle(f func(ctx context.Context, request *PhoneEditGroupCallTitleRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneEditGroupCallTitleRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneEditGroupCallTitleRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneGetGroupCallJoinAs(f func(ctx context.Context, peer InputPeerClass) (*PhoneJoinAsPeers, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneGetGroupCallJoinAsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Peer) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneGetGroupCallJoinAsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneExportGroupCallInvite(f func(ctx context.Context, request *PhoneExportGroupCallInviteRequest) (*PhoneExportedGroupCallInvite, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneExportGroupCallInviteRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneExportGroupCallInviteRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneToggleGroupCallStartSubscription(f func(ctx context.Context, request *PhoneToggleGroupCallStartSubscriptionRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneToggleGroupCallStartSubscriptionRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneToggleGroupCallStartSubscriptionRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneStartScheduledGroupCall(f func(ctx context.Context, call InputGroupCall) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneStartScheduledGroupCallRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Call) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneStartScheduledGroupCallRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneSaveDefaultGroupCallJoinAs(f func(ctx context.Context, request *PhoneSaveDefaultGroupCallJoinAsRequest) (bool, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneSaveDefaultGroupCallJoinAsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
if response { |
|
return &BoolBox{Bool: &BoolTrue{}}, nil |
|
} |
|
|
|
return &BoolBox{Bool: &BoolFalse{}}, nil |
|
} |
|
|
|
s.handlers[PhoneSaveDefaultGroupCallJoinAsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneJoinGroupCallPresentation(f func(ctx context.Context, request *PhoneJoinGroupCallPresentationRequest) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneJoinGroupCallPresentationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneJoinGroupCallPresentationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneLeaveGroupCallPresentation(f func(ctx context.Context, call InputGroupCall) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneLeaveGroupCallPresentationRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Call) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[PhoneLeaveGroupCallPresentationRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneGetGroupCallStreamChannels(f func(ctx context.Context, call InputGroupCall) (*PhoneGroupCallStreamChannels, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneGetGroupCallStreamChannelsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.Call) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneGetGroupCallStreamChannelsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnPhoneGetGroupCallStreamRtmpURL(f func(ctx context.Context, request *PhoneGetGroupCallStreamRtmpURLRequest) (*PhoneGroupCallStreamRtmpURL, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request PhoneGetGroupCallStreamRtmpURLRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[PhoneGetGroupCallStreamRtmpURLRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnLangpackGetLangPack(f func(ctx context.Context, request *LangpackGetLangPackRequest) (*LangPackDifference, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request LangpackGetLangPackRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[LangpackGetLangPackRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnLangpackGetStrings(f func(ctx context.Context, request *LangpackGetStringsRequest) ([]LangPackStringClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request LangpackGetStringsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &LangPackStringClassVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[LangpackGetStringsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnLangpackGetDifference(f func(ctx context.Context, request *LangpackGetDifferenceRequest) (*LangPackDifference, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request LangpackGetDifferenceRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[LangpackGetDifferenceRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnLangpackGetLanguages(f func(ctx context.Context, langpack string) ([]LangPackLanguage, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request LangpackGetLanguagesRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.LangPack) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &LangPackLanguageVector{Elems: response}, nil |
|
} |
|
|
|
s.handlers[LangpackGetLanguagesRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnLangpackGetLanguage(f func(ctx context.Context, request *LangpackGetLanguageRequest) (*LangPackLanguage, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request LangpackGetLanguageRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[LangpackGetLanguageRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnFoldersEditPeerFolders(f func(ctx context.Context, folderpeers []InputFolderPeer) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request FoldersEditPeerFoldersRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.FolderPeers) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[FoldersEditPeerFoldersRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnFoldersDeleteFolder(f func(ctx context.Context, folderid int) (UpdatesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request FoldersDeleteFolderRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, request.FolderID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &UpdatesBox{Updates: response}, nil |
|
} |
|
|
|
s.handlers[FoldersDeleteFolderRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStatsGetBroadcastStats(f func(ctx context.Context, request *StatsGetBroadcastStatsRequest) (*StatsBroadcastStats, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StatsGetBroadcastStatsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[StatsGetBroadcastStatsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStatsLoadAsyncGraph(f func(ctx context.Context, request *StatsLoadAsyncGraphRequest) (StatsGraphClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StatsLoadAsyncGraphRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &StatsGraphBox{StatsGraph: response}, nil |
|
} |
|
|
|
s.handlers[StatsLoadAsyncGraphRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStatsGetMegagroupStats(f func(ctx context.Context, request *StatsGetMegagroupStatsRequest) (*StatsMegagroupStats, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StatsGetMegagroupStatsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[StatsGetMegagroupStatsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStatsGetMessagePublicForwards(f func(ctx context.Context, request *StatsGetMessagePublicForwardsRequest) (MessagesMessagesClass, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StatsGetMessagePublicForwardsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return &MessagesMessagesBox{Messages: response}, nil |
|
} |
|
|
|
s.handlers[StatsGetMessagePublicForwardsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnStatsGetMessageStats(f func(ctx context.Context, request *StatsGetMessageStatsRequest) (*StatsMessageStats, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request StatsGetMessageStatsRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx, &request) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[StatsGetMessageStatsRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnTestUseError(f func(ctx context.Context) (*Error, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request TestUseErrorRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[TestUseErrorRequestTypeID] = handler |
|
} |
|
|
|
func (s *ServerDispatcher) OnTestUseConfigSimple(f func(ctx context.Context) (*HelpConfigSimple, error)) { |
|
handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { |
|
var request TestUseConfigSimpleRequest |
|
if err := request.Decode(b); err != nil { |
|
return nil, err |
|
} |
|
|
|
response, err := f(ctx) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return response, nil |
|
} |
|
|
|
s.handlers[TestUseConfigSimpleRequestTypeID] = handler |
|
}
|
|
|