move gotd fork into repo. (#111)
- update to latest telegram layer - remove some references to fields in tg.Entities that don't exist in the schema - originally added here: https://github.com/beeper/td/commit/820929062a2ba0104397bc01235ab58a9cff780e - referenced here - https://github.com/mautrix/telegramgo/commit/124f0967ed195b5a380c9bd02e170ada9710dde3 - https://github.com/mautrix/telegramgo/commit/4205047aab2e0639217148b5d125bfaab668bd8e
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
|
||||
)
|
||||
|
||||
// ResultTypeID is TL type id of Result.
|
||||
const ResultTypeID = 0xf35c6d01
|
||||
|
||||
// Result is rpc_result#f35c6d01.
|
||||
type Result struct {
|
||||
RequestMessageID int64
|
||||
Result []byte
|
||||
}
|
||||
|
||||
// Encode implements bin.Encoder.
|
||||
func (r *Result) Encode(b *bin.Buffer) error {
|
||||
b.PutID(ResultTypeID)
|
||||
b.PutLong(r.RequestMessageID)
|
||||
b.Put(r.Result)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Decode implements bin.Decoder.
|
||||
func (r *Result) Decode(b *bin.Buffer) error {
|
||||
if err := b.ConsumeID(ResultTypeID); err != nil {
|
||||
return err
|
||||
}
|
||||
{
|
||||
v, err := b.Long()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r.RequestMessageID = v
|
||||
}
|
||||
|
||||
r.Result = append(r.Result[:0], b.Buf...)
|
||||
b.Skip(len(b.Buf))
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user