Documentation ¶
Index ¶
- Constants
- func AddQtsToUpdatesQueue(userId, qts, updateType int32, updateData []byte) int32
- func AddSeqToUpdatesQueue(authId int64, userId, seq, updateType int32, updateData []byte) int32
- func AddToChannelPtsQueue(channelId, pts, ptsCount int32, update *mtproto.Update) int32
- func AddToPtsQueue(userId, pts, ptsCount int32, update *mtproto.Update) int32
- func CheckAndFixAuthUpdateSeq(authKeyId int64, userId int32)
- func CurrentChannelMessageBoxId(key string) (seq int64)
- func CurrentChannelPtsId(key string) (seq int64)
- func CurrentMessageBoxId(key string) (seq int64)
- func CurrentPtsId(key string) (seq int64)
- func CurrentQtsId(key string) (seq int64)
- func CurrentSeqId(key string) (seq int64)
- func GetChannelUpdateListByGtPts(channelId, pts int32) []*mtproto.Update
- func GetServerUpdatesState(authKeyId int64, userId int32) *mtproto.TLUpdatesState
- func GetUpdateListByGtPts(userId, pts int32) []*mtproto.Update
- func GetUpdatesState(authKeyId int64, userId int32) *mtproto.TLUpdatesState
- func GetUpdatesState2(authKeyId int64, userId int32) *mtproto.TLUpdatesState
- func NextChannelMessageBoxId(key string) (seq int64)
- func NextChannelPtsId(key string) (seq int64)
- func NextMessageBoxId(key string) (seq int64)
- func NextPtsId(key string) (seq int64)
- func NextQtsId(key string) (seq int64)
- func NextSeqId(key string) (seq int64)
- func UpdateAuthStateSeq(authKeyId int64, pts, qts int32)
- func UpdateServerAuthStateSeq(authKeyId int64, pts, qts int32)
- type UpdatesLogic
- func NewUpdatesLogic(userId int32) *UpdatesLogic
- func NewUpdatesLogicByMessage(userId int32, message *mtproto.Message) *UpdatesLogic
- func NewUpdatesLogicByUpdate(userId int32, update *mtproto.Update) *UpdatesLogic
- func NewUpdatesLogicByUpdates(userId int32, updateList []*mtproto.Update) *UpdatesLogic
- func (this *UpdatesLogic) AddChat(chat *mtproto.Chat)
- func (this *UpdatesLogic) AddChats(chatList []*mtproto.Chat)
- func (this *UpdatesLogic) AddUpdate(update *mtproto.Update)
- func (this *UpdatesLogic) AddUpdateMessageId(messageId int32, randomId int64)
- func (this *UpdatesLogic) AddUpdateNewChannelMessage(message *mtproto.Message)
- func (this *UpdatesLogic) AddUpdateNewMessage(message *mtproto.Message)
- func (this *UpdatesLogic) AddUpdates(updateList []*mtproto.Update)
- func (this *UpdatesLogic) AddUser(user *mtproto.User)
- func (this *UpdatesLogic) AddUsers(userList []*mtproto.User)
- func (this *UpdatesLogic) PushTopUpdateMessageId(messageId int32, randomId int64)
- func (this *UpdatesLogic) SetupState(state *mtproto.ClientUpdatesState)
- func (this *UpdatesLogic) ToUpdateShort() *mtproto.Updates
- func (this *UpdatesLogic) ToUpdateShortChatMessage() *mtproto.Updates
- func (this *UpdatesLogic) ToUpdateShortMessage() *mtproto.Updates
- func (this *UpdatesLogic) ToUpdateShortSentMessage() *mtproto.Updates
- func (this *UpdatesLogic) ToUpdateTooLong() *mtproto.Updates
- func (this *UpdatesLogic) ToUpdates() *mtproto.Updates
- func (this *UpdatesLogic) ToUpdatesCombined() *mtproto.Updates
Constants ¶
View Source
const ( PTS_UPDATE_TYPE_UNKNOWN = 0 // pts PTS_UPDATE_NEW_MESSAGE = 1 PTS_UPDATE_DELETE_MESSAGES = 2 PTS_UPDATE_READ_HISTORY_OUTBOX = 3 PTS_UPDATE_READ_HISTORY_INBOX = 4 PTS_UPDATE_WEBPAGE = 5 PTS_UPDATE_READ_MESSAGE_CONENTS = 6 PTS_UPDATE_EDIT_MESSAGE = 7 // qts PTS_UPDATE_NEW_ENCRYPTED_MESSAGE = 8 // channel pts PTS_UPDATE_NEW_CHANNEL_MESSAGE = 9 PTS_UPDATE_DELETE_CHANNEL_MESSAGES = 9 PTS_UPDATE_EDIT_CHANNEL_MESSAGE = 10 PTS_UPDATE_EDIT_CHANNEL_WEBPAGE = 11 )
private int getUpdateType(TLRPC.Update update) { if (update instanceof TLRPC.TL_updateNewMessage || update instanceof TLRPC.TL_updateReadMessagesContents || update instanceof TLRPC.TL_updateReadHistoryInbox || update instanceof TLRPC.TL_updateReadHistoryOutbox || update instanceof TLRPC.TL_updateDeleteMessages || update instanceof TLRPC.TL_updateWebPage || update instanceof TLRPC.TL_updateEditMessage) { return 0; } else if (update instanceof TLRPC.TL_updateNewEncryptedMessage) { return 1; } else if (update instanceof TLRPC.TL_updateNewChannelMessage || update instanceof TLRPC.TL_updateDeleteChannelMessages || update instanceof TLRPC.TL_updateEditChannelMessage || update instanceof TLRPC.TL_updateChannelWebPage) { return 2; } else { return 3; } }
Variables ¶
This section is empty.
Functions ¶
func AddQtsToUpdatesQueue ¶
func AddSeqToUpdatesQueue ¶
func AddToChannelPtsQueue ¶
func CurrentChannelPtsId ¶
func CurrentMessageBoxId ¶
func CurrentPtsId ¶
func CurrentQtsId ¶
func CurrentSeqId ¶
func GetServerUpdatesState ¶
func GetServerUpdatesState(authKeyId int64, userId int32) *mtproto.TLUpdatesState
func GetUpdateListByGtPts ¶
func GetUpdatesState ¶
func GetUpdatesState(authKeyId int64, userId int32) *mtproto.TLUpdatesState
func GetUpdatesState2 ¶
func GetUpdatesState2(authKeyId int64, userId int32) *mtproto.TLUpdatesState
func NextChannelMessageBoxId ¶
func NextChannelPtsId ¶
func NextMessageBoxId ¶
func UpdateAuthStateSeq ¶
Types ¶
type UpdatesLogic ¶
type UpdatesLogic struct {
// contains filtered or unexported fields
}
func NewUpdatesLogic ¶
func NewUpdatesLogic(userId int32) *UpdatesLogic
///////////////////////////////////////////////////////////////////////////////////////
func NewUpdatesLogicByMessage ¶
func NewUpdatesLogicByMessage(userId int32, message *mtproto.Message) *UpdatesLogic
func NewUpdatesLogicByUpdate ¶
func NewUpdatesLogicByUpdate(userId int32, update *mtproto.Update) *UpdatesLogic
func NewUpdatesLogicByUpdates ¶
func NewUpdatesLogicByUpdates(userId int32, updateList []*mtproto.Update) *UpdatesLogic
func (*UpdatesLogic) AddChat ¶
func (this *UpdatesLogic) AddChat(chat *mtproto.Chat)
func (*UpdatesLogic) AddChats ¶
func (this *UpdatesLogic) AddChats(chatList []*mtproto.Chat)
func (*UpdatesLogic) AddUpdate ¶
func (this *UpdatesLogic) AddUpdate(update *mtproto.Update)
func (*UpdatesLogic) AddUpdateMessageId ¶
func (this *UpdatesLogic) AddUpdateMessageId(messageId int32, randomId int64)
func (*UpdatesLogic) AddUpdateNewChannelMessage ¶
func (this *UpdatesLogic) AddUpdateNewChannelMessage(message *mtproto.Message)
func (*UpdatesLogic) AddUpdateNewMessage ¶
func (this *UpdatesLogic) AddUpdateNewMessage(message *mtproto.Message)
///////////////////////////////////////////////////////////////////////////////////////
func (*UpdatesLogic) AddUpdates ¶
func (this *UpdatesLogic) AddUpdates(updateList []*mtproto.Update)
///////////////////////////////////////////////////////////////////////////////////////
func (*UpdatesLogic) AddUser ¶
func (this *UpdatesLogic) AddUser(user *mtproto.User)
func (*UpdatesLogic) AddUsers ¶
func (this *UpdatesLogic) AddUsers(userList []*mtproto.User)
func (*UpdatesLogic) PushTopUpdateMessageId ¶
func (this *UpdatesLogic) PushTopUpdateMessageId(messageId int32, randomId int64)
func (*UpdatesLogic) SetupState ¶
func (this *UpdatesLogic) SetupState(state *mtproto.ClientUpdatesState)
/////////////////////////////////////////////////////////////////////////////////////// TODO(@benqi): check error
func (*UpdatesLogic) ToUpdateShort ¶
func (this *UpdatesLogic) ToUpdateShort() *mtproto.Updates
func (*UpdatesLogic) ToUpdateShortChatMessage ¶
func (this *UpdatesLogic) ToUpdateShortChatMessage() *mtproto.Updates
func (*UpdatesLogic) ToUpdateShortMessage ¶
func (this *UpdatesLogic) ToUpdateShortMessage() *mtproto.Updates
func (*UpdatesLogic) ToUpdateShortSentMessage ¶
func (this *UpdatesLogic) ToUpdateShortSentMessage() *mtproto.Updates
func (*UpdatesLogic) ToUpdateTooLong ¶
func (this *UpdatesLogic) ToUpdateTooLong() *mtproto.Updates
///////////////////////////////////////////////////////////////////////////////////////
func (*UpdatesLogic) ToUpdates ¶
func (this *UpdatesLogic) ToUpdates() *mtproto.Updates
func (*UpdatesLogic) ToUpdatesCombined ¶
func (this *UpdatesLogic) ToUpdatesCombined() *mtproto.Updates
Click to show internal directories.
Click to hide internal directories.