updates

package
v0.0.0-...-6e21e7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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 AddQtsToUpdatesQueue(userId, qts, updateType int32, updateData []byte) int32

func AddSeqToUpdatesQueue

func AddSeqToUpdatesQueue(authId int64, userId, seq, updateType int32, updateData []byte) int32

func AddToChannelPtsQueue

func AddToChannelPtsQueue(channelId, pts, ptsCount int32, update *mtproto.Update) int32

func AddToPtsQueue

func AddToPtsQueue(userId, pts, ptsCount int32, update *mtproto.Update) int32

func CheckAndFixAuthUpdateSeq

func CheckAndFixAuthUpdateSeq(authKeyId int64, userId int32)

func CurrentChannelMessageBoxId

func CurrentChannelMessageBoxId(key string) (seq int64)

func CurrentChannelPtsId

func CurrentChannelPtsId(key string) (seq int64)

func CurrentMessageBoxId

func CurrentMessageBoxId(key string) (seq int64)

func CurrentPtsId

func CurrentPtsId(key string) (seq int64)

func CurrentQtsId

func CurrentQtsId(key string) (seq int64)

func CurrentSeqId

func CurrentSeqId(key string) (seq int64)

func GetChannelUpdateListByGtPts

func GetChannelUpdateListByGtPts(channelId, pts int32) []*mtproto.Update

func GetServerUpdatesState

func GetServerUpdatesState(authKeyId int64, userId int32) *mtproto.TLUpdatesState

func GetUpdateListByGtPts

func GetUpdateListByGtPts(userId, pts int32) []*mtproto.Update

func GetUpdatesState

func GetUpdatesState(authKeyId int64, userId int32) *mtproto.TLUpdatesState

func GetUpdatesState2

func GetUpdatesState2(authKeyId int64, userId int32) *mtproto.TLUpdatesState

func NextChannelMessageBoxId

func NextChannelMessageBoxId(key string) (seq int64)

func NextChannelPtsId

func NextChannelPtsId(key string) (seq int64)

func NextMessageBoxId

func NextMessageBoxId(key string) (seq int64)

func NextPtsId

func NextPtsId(key string) (seq int64)

func NextQtsId

func NextQtsId(key string) (seq int64)

func NextSeqId

func NextSeqId(key string) (seq int64)

func UpdateAuthStateSeq

func UpdateAuthStateSeq(authKeyId int64, pts, qts int32)

func UpdateServerAuthStateSeq

func UpdateServerAuthStateSeq(authKeyId int64, pts, qts int32)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL