gotd: invoke with layer every time

Cherry-picked from upstream PR 1640. The reason is that tracking whether
the Telegram servers received our layer number is hard, so it's more
reliable to just always send it.
This commit is contained in:
Tulir Asokan
2025-12-03 14:10:42 +02:00
parent b7459ec9eb
commit b38c3cc935
+7 -1
View File
@@ -167,7 +167,13 @@ func (c *Conn) Invoke(ctx context.Context, input bin.Encoder, output bin.Decoder
return errors.Wrap(err, "waitSession")
}
return c.proto.Invoke(ctx, c.wrapRequest(noopDecoder{input}), output)
q := c.wrapRequest(noopDecoder{input})
req := c.wrapRequest(&tg.InvokeWithLayerRequest{
Layer: tg.Layer,
Query: q,
})
return c.proto.Invoke(ctx, req, output)
}
// OnMessage implements mtproto.Handler.