message

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE_TYPE_UNKNOWN         = 0
	MESSAGE_TYPE_MESSAGE_EMPTY   = 1
	MESSAGE_TYPE_MESSAGE         = 2
	MESSAGE_TYPE_MESSAGE_SERVICE = 3
)
View Source
const (
	MESSAGE_BOX_TYPE_INCOMING = 0
	MESSAGE_BOX_TYPE_OUTGOING = 1
)
View Source
const (
	PTS_UNKNOWN             = 0
	PTS_MESSAGE_OUTBOX      = 1
	PTS_MESSAGE_INBOX       = 2
	PTS_READ_HISTORY_OUTBOX = 3
	PTS_READ_HISTORY_INBOX  = 4
)

Variables

This section is empty.

Functions

func DeleteByMessageIdList

func DeleteByMessageIdList(userId int32, idList []int32)

func GetChannelMessage

func GetChannelMessage(channelId int32, id int32) (message *mtproto.Message)

func GetChannelMessageList

func GetChannelMessageList(channelId int32, idList []int32) (messages []*mtproto.Message)

func GetMessageByPeerAndMessageId

func GetMessageByPeerAndMessageId(userId int32, messageId int32) (message *mtproto.Message)

//////////////////////////////////////////////////////////////////////////////////////////////////

func GetMessageIdListByDialog

func GetMessageIdListByDialog(userId int32, peer *base.PeerUtil) []int32

///////////////////////////////////

func GetMessagesByPeerAndMessageIdList2

func GetMessagesByPeerAndMessageIdList2(userId int32, idList []int32) (messages []*mtproto.Message)

func GetPeerMessageId

func GetPeerMessageId(userId, messageId, peerId int32) int32

///////////////////////////////////

func LoadBackwardHistoryMessages

func LoadBackwardHistoryMessages(userId int32, peerType, peerId int32, offset int32, limit int32) (messages []*mtproto.Message)

////////////////////////////////////////////////////////////////////////////////////////////////// Loadhistory

func LoadForwardHistoryMessages

func LoadForwardHistoryMessages(userId int32, peerType, peerId int32, offset int32, limit int32) (messages []*mtproto.Message)

func MessageToUpdateShortChatMessage

func MessageToUpdateShortChatMessage(message2 *mtproto.Message) (shortMessage *mtproto.TLUpdateShortChatMessage)

updateShortChatMessage#16812688 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;

func MessageToUpdateShortMessage

func MessageToUpdateShortMessage(message2 *mtproto.Message) (shortMessage *mtproto.TLUpdateShortMessage)

updateShortMessage#914fbf11 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates; message#44f9b43d flags:#

out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long = Message;

messageService#9e19a1f6 flags:#

out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer reply_to_msg_id:flags.3?int date:int action:MessageAction = Message;

func MessageToUpdateShortSentMessage

func MessageToUpdateShortSentMessage(message2 *mtproto.Message) (sentMessage *mtproto.TLUpdateShortSentMessage)

// updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;

func PickAllIDListByDialogs

func PickAllIDListByDialogs(dialogs []*mtproto.Dialog) (messageIdList, userIdList, chatIdList, channelIdList []int32)

func PickAllIDListByMessages

func PickAllIDListByMessages(messageList []*mtproto.Message) (userIdList, chatIdList, channelIdList []int32)

func SaveMessage

func SaveMessage(message *mtproto.Message, userId, messageId int32) error

func SendMessageToOutbox

func SendMessageToOutbox(fromId int32, peer *base.PeerUtil, clientRandomId int64, message2 *mtproto.Message) (boxId int32, dialogMessageId int64)

SendMessage 发送到发件箱

Types

type ChannelBoxCreated

type ChannelBoxCreated func(int32)

type ChannelMessageBox

type ChannelMessageBox struct {
	SenderUserId        int32
	ChannelId           int32
	ChannelMessageBoxId int32
	MessageId           int64
	RandomId            int64
	Message             *mtproto.Message
}

func CreateChannelMessageBoxByNew

func CreateChannelMessageBoxByNew(fromId, channelId int32, clientRandomId int64, message2 *mtproto.Message, cb ChannelBoxCreated) (box *ChannelMessageBox)

type InboxMessages

type InboxMessages struct {
	UserIds  []int32
	Messages []*mtproto.Message
}

////////////////////////////////////////////////////////////////////////////////////////////////// sendMessage 所有收件箱信息

func GetPeerDialogMessageListByMessageId

func GetPeerDialogMessageListByMessageId(userId int32, messageId int32) (messages *InboxMessages)

func SendMessageToInbox

func SendMessageToInbox(fromId int32, peer *base.PeerUtil, clientRandomId, dialogMessageId int64, outboxMessage *mtproto.Message) (*InboxMessages, error)

发送到收件箱

type MessageBox

type MessageBox struct {
	UserId          int32
	MessageId       int32
	DialogMessageId int64
	RandomId        int64
	Message         *mtproto.Message
}

func CreateMessageOutboxByNew

func CreateMessageOutboxByNew(fromId int32, peer *base.PeerUtil, clientRandomId int64, message2 *mtproto.Message, cb OnOutboxCreated) (box *MessageBox)

新增

func GetMessageBoxListByMessageIdList

func GetMessageBoxListByMessageIdList(userId int32, idList []int32) []*MessageBox

func MakeMessageBoxByLoad

func MakeMessageBoxByLoad(userId int32, peer *base.PeerUtil, messageId int32) (box *MessageBox)

func (*MessageBox) InsertMessageToInbox

func (this *MessageBox) InsertMessageToInbox(fromId int32, peer *base.PeerUtil, cb OnInboxSendOK) (MessageBoxList, error)

type MessageBoxList

type MessageBoxList []*MessageBox

func (*MessageBoxList) ToMessageList

func (this *MessageBoxList) ToMessageList() []*mtproto.Message

//////////////////////////////////////////////////////////////////////////////////////////////////////////

type MessageLogic

type MessageLogic struct {
}

type OnInboxSendOK

type OnInboxSendOK func(int32, int32)

type OnOutboxCreated

type OnOutboxCreated func(int32)

type OnOutboxCreated

Jump to

Keyboard shortcuts

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