Documentation ¶
Index ¶
- Constants
- func GetMessageByPeerAndMessageId(userId int32, messageId int32) (message *mtproto.Message)
- func GetMessagesByPeerAndMessageIdList2(userId int32, idList []int32) (messages []*mtproto.Message)
- func GetPeerMessageId(userId, messageId, peerId int32) int32
- func LoadBackwardHistoryMessages(userId int32, peerType, peerId int32, offset int32, limit int32) (messages []*mtproto.Message)
- func LoadForwardHistoryMessages(userId int32, peerType, peerId int32, offset int32, limit int32) (messages []*mtproto.Message)
- func MessageToUpdateShortChatMessage(message2 *mtproto.Message) (shortMessage *mtproto.TLUpdateShortChatMessage)
- func MessageToUpdateShortMessage(message2 *mtproto.Message) (shortMessage *mtproto.TLUpdateShortMessage)
- func MessageToUpdateShortSentMessage(message2 *mtproto.Message) (sentMessage *mtproto.TLUpdateShortSentMessage)
- func PickAllIDListByDialogs(dialogs []*mtproto.Dialog) (messageIdList, userIdList, chatIdList, channelIdList []int32)
- func PickAllIDListByMessages(messageList []*mtproto.Message) (userIdList, chatIdList, channelIdList []int32)
- func SaveMessage(message *mtproto.Message, userId, messageId int32) error
- func SendMessageToOutbox(fromId int32, peer *base.PeerUtil, clientRandomId int64, ...) (boxId int32, dialogMessageId int64)
- type InboxMessages
- type MessageBox
- type MessageBoxList
- type MessageLogic
- type OnInboxSendOK
- type OnOutboxCreated
Constants ¶
const ( MESSAGE_TYPE_UNKNOWN = 0 MESSAGE_TYPE_MESSAGE_EMPTY = 1 MESSAGE_TYPE_MESSAGE = 2 MESSAGE_TYPE_MESSAGE_SERVICE = 3 )
const ( MESSAGE_BOX_TYPE_INCOMING = 0 MESSAGE_BOX_TYPE_OUTGOING = 1 )
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 GetMessageByPeerAndMessageId ¶
//////////////////////////////////////////////////////////////////////////////////////////////////
func GetPeerMessageId ¶
///////////////////////////////////
func LoadBackwardHistoryMessages ¶
func LoadBackwardHistoryMessages(userId int32, peerType, peerId int32, offset int32, limit int32) (messages []*mtproto.Message)
////////////////////////////////////////////////////////////////////////////////////////////////// Loadhistory
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 PickAllIDListByMessages ¶
Types ¶
type InboxMessages ¶
////////////////////////////////////////////////////////////////////////////////////////////////// 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 { }