Source File
handle_message.go
Belonging Package
github.com/gotd/td/internal/mtproto
package mtproto
import (
)
func ( *Conn) ( int64, *bin.Buffer) error {
, := .PeekID()
if != nil {
// Empty body.
return errors.Wrap(, "peek message type")
}
.logWithBuffer().Debug("Handle message", zap.Int64("msg_id", ))
switch {
case mt.NewSessionCreatedTypeID:
return .handleSessionCreated()
case mt.BadMsgNotificationTypeID, mt.BadServerSaltTypeID:
return .handleBadMsg()
case mt.FutureSaltsTypeID:
return .handleFutureSalts()
case proto.MessageContainerTypeID:
return .handleContainer(, )
case proto.ResultTypeID:
return .handleResult()
case mt.PongTypeID:
return .handlePong()
case mt.MsgsAckTypeID:
return .handleAck()
case proto.GZIPTypeID:
return .handleGZIP(, )
case mt.MsgDetailedInfoTypeID,
mt.MsgNewDetailedInfoTypeID:
return nil
default:
return .handler.OnMessage()
}
}
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |