conversation_msg

package
v3.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SearchContentType = []int{constant.Text, constant.AtText, constant.File}

Functions

func DeleteUserReactionElem

func DeleteUserReactionElem(a []*sdk_struct.UserReactionElem, userID string) []*sdk_struct.UserReactionElem

func LocalConversationToServer

func LocalConversationToServer(conversation *model_struct.LocalConversation) *pbConversation.Conversation

func NewUploadFileCallback

func NewUploadFileCallback(ctx context.Context, progress func(progress int), msg *sdk_struct.MsgStruct, conversationID string, db db_interface.DataBase) file.UploadFileCallback

func ServerConversationToLocal

func ServerConversationToLocal(conversation *pbConversation.Conversation) *model_struct.LocalConversation

Types

type Conversation

type Conversation struct {
	*interaction.LongConnMgr

	ConversationListener func() open_im_sdk_callback.OnConversationListener

	DataDir string

	IsExternalExtensions bool
	// contains filtered or unexported fields
}

func NewConversation

func NewConversation(ctx context.Context, longConnMgr *interaction.LongConnMgr, db db_interface.DataBase,
	ch chan common.Cmd2Value, friend *friend.Friend, group *group.Group, user *user.User, business *business.Business,
	full *full.Full, file *file.File) *Conversation

func (*Conversation) AddMessageReactionExtensions

func (c *Conversation) AddMessageReactionExtensions(ctx context.Context, s *sdk_struct.MsgStruct, reactionExtensionList []*server_api_params.KeyValue) ([]*server_api_params.ExtensionResult, error)

func (*Conversation) ChangeInputStates added in v3.5.1

func (c *Conversation) ChangeInputStates(ctx context.Context, conversationID string, focus bool) error

func (*Conversation) ClearConversationAndDeleteAllMsg

func (c *Conversation) ClearConversationAndDeleteAllMsg(ctx context.Context, conversationID string) error

func (*Conversation) CreateAdvancedQuoteMessage

func (c *Conversation) CreateAdvancedQuoteMessage(ctx context.Context, text string, qs *sdk_struct.MsgStruct, messageEntities []*sdk_struct.MessageEntity) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateAdvancedTextMessage

func (c *Conversation) CreateAdvancedTextMessage(ctx context.Context, text string, messageEntities []*sdk_struct.MessageEntity) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateCardMessage

func (c *Conversation) CreateCardMessage(ctx context.Context, card *sdk_struct.CardElem) (*sdk_struct.MsgStruct,
	error)

func (*Conversation) CreateCustomMessage

func (c *Conversation) CreateCustomMessage(ctx context.Context, data, extension string, description string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateFaceMessage

func (c *Conversation) CreateFaceMessage(ctx context.Context, index int, data string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateFileMessage

func (c *Conversation) CreateFileMessage(ctx context.Context, filePath string, fileName string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateFileMessageByURL

func (c *Conversation) CreateFileMessageByURL(ctx context.Context, fileElem sdk_struct.FileBaseInfo) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateFileMessageFromFullPath

func (c *Conversation) CreateFileMessageFromFullPath(ctx context.Context, fileFullPath string, fileName string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateForwardMessage

func (c *Conversation) CreateForwardMessage(ctx context.Context, s *sdk_struct.MsgStruct) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateImageMessage

func (c *Conversation) CreateImageMessage(ctx context.Context, imagePath string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateImageMessageByURL

func (c *Conversation) CreateImageMessageByURL(ctx context.Context, sourcePath string, sourcePicture, bigPicture, snapshotPicture sdk_struct.PictureBaseInfo) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateImageMessageFromFullPath

func (c *Conversation) CreateImageMessageFromFullPath(ctx context.Context, imageFullPath string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateLocationMessage

func (c *Conversation) CreateLocationMessage(ctx context.Context, description string, longitude, latitude float64) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateMergerMessage

func (c *Conversation) CreateMergerMessage(ctx context.Context, messages []*sdk_struct.MsgStruct, title string, summaries []string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateQuoteMessage

func (c *Conversation) CreateQuoteMessage(ctx context.Context, text string, qs *sdk_struct.MsgStruct) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateSoundMessage

func (c *Conversation) CreateSoundMessage(ctx context.Context, soundPath string, duration int64) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateSoundMessageByURL

func (c *Conversation) CreateSoundMessageByURL(ctx context.Context, soundElem *sdk_struct.SoundBaseInfo) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateSoundMessageFromFullPath

func (c *Conversation) CreateSoundMessageFromFullPath(ctx context.Context, soundPath string, duration int64) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateTextAtMessage

func (c *Conversation) CreateTextAtMessage(ctx context.Context, text string, userIDList []string, usersInfo []*sdk_struct.AtInfo, qs *sdk_struct.MsgStruct) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateTextMessage

func (c *Conversation) CreateTextMessage(ctx context.Context, text string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateVideoMessage

func (c *Conversation) CreateVideoMessage(ctx context.Context, videoPath string, videoType string, duration int64, snapshotPath string) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateVideoMessageByURL

func (c *Conversation) CreateVideoMessageByURL(ctx context.Context, videoElem sdk_struct.VideoBaseInfo) (*sdk_struct.MsgStruct, error)

func (*Conversation) CreateVideoMessageFromFullPath

func (c *Conversation) CreateVideoMessageFromFullPath(ctx context.Context, videoFullPath string, videoType string,
	duration int64, snapshotFullPath string) (*sdk_struct.MsgStruct, error)

func (*Conversation) DeleteAllMessageFromLocalStorage

func (c *Conversation) DeleteAllMessageFromLocalStorage(ctx context.Context) error

func (*Conversation) DeleteAllMsgFromLocalAndSvr added in v3.4.0

func (c *Conversation) DeleteAllMsgFromLocalAndSvr(ctx context.Context) error

func (*Conversation) DeleteConversationAndDeleteAllMsg

func (c *Conversation) DeleteConversationAndDeleteAllMsg(ctx context.Context, conversationID string) error

func (*Conversation) DeleteMessage

func (c *Conversation) DeleteMessage(ctx context.Context, conversationID string, clientMsgID string) error

func (*Conversation) DeleteMessageFromLocalStorage

func (c *Conversation) DeleteMessageFromLocalStorage(ctx context.Context, conversationID string, clientMsgID string) error

delete

func (*Conversation) DeleteMessageReactionExtensions

func (c *Conversation) DeleteMessageReactionExtensions(ctx context.Context, s *sdk_struct.MsgStruct, reactionExtensionKeyList []string) ([]*server_api_params.ExtensionResult, error)

func (*Conversation) DoConversationChangedNotification

func (c *Conversation) DoConversationChangedNotification(ctx context.Context, msg *sdkws.MsgData)

func (*Conversation) DoConversationIsPrivateChangedNotification

func (c *Conversation) DoConversationIsPrivateChangedNotification(ctx context.Context, msg *sdkws.MsgData)

func (*Conversation) DoMsgReaction

func (c *Conversation) DoMsgReaction(msgReactionList []*sdk_struct.MsgStruct)

func (*Conversation) GetAllConversationList

func (c *Conversation) GetAllConversationList(ctx context.Context) ([]*model_struct.LocalConversation, error)

func (*Conversation) GetAtAllTag

func (c *Conversation) GetAtAllTag(_ context.Context) string

func (*Conversation) GetCh

func (c *Conversation) GetCh() chan common.Cmd2Value

func (*Conversation) GetConversationIDBySessionType

func (c *Conversation) GetConversationIDBySessionType(_ context.Context, sourceID string, sessionType int) string

func (*Conversation) GetConversationListSplit

func (c *Conversation) GetConversationListSplit(ctx context.Context, offset, count int) ([]*model_struct.LocalConversation, error)

func (*Conversation) GetConversationRecvMessageOpt

func (c *Conversation) GetConversationRecvMessageOpt(ctx context.Context, conversationIDs []string) (resp []*server_api_params.GetConversationRecvMessageOptResp, err error)

deprecated

func (*Conversation) GetInputStates added in v3.5.1

func (c *Conversation) GetInputStates(ctx context.Context, conversationID string, userID string) ([]int32, error)

func (*Conversation) GetMessageListReactionExtensions

func (c *Conversation) GetMessageListReactionExtensions(ctx context.Context, conversationID string, messageList []*sdk_struct.MsgStruct) ([]*server_api_params.SingleMessageExtensionResult, error)

func (*Conversation) GetMultipleConversation

func (c *Conversation) GetMultipleConversation(ctx context.Context, conversationIDList []string) ([]*model_struct.LocalConversation, error)

func (*Conversation) GetOneConversation

func (c *Conversation) GetOneConversation(ctx context.Context, sessionType int32, sourceID string) (*model_struct.LocalConversation, error)

Method to set global message receiving options

func (*Conversation) GetTotalUnreadMsgCount

func (c *Conversation) GetTotalUnreadMsgCount(ctx context.Context) (totalUnreadCount int32, err error)

func (*Conversation) HideAllConversations added in v3.4.0

func (c *Conversation) HideAllConversations(ctx context.Context) error

func (*Conversation) HideConversation

func (c *Conversation) HideConversation(ctx context.Context, conversationID string) error

func (*Conversation) InsertGroupMessageToLocalStorage

func (c *Conversation) InsertGroupMessageToLocalStorage(ctx context.Context, s *sdk_struct.MsgStruct, groupID, sendID string) (*sdk_struct.MsgStruct, error)

func (*Conversation) InsertSingleMessageToLocalStorage

func (c *Conversation) InsertSingleMessageToLocalStorage(ctx context.Context, s *sdk_struct.MsgStruct, recvID, sendID string) (*sdk_struct.MsgStruct, error)

insert

func (*Conversation) MarkConversationMessageAsRead

func (c *Conversation) MarkConversationMessageAsRead(ctx context.Context, conversationID string) error

read draw

func (*Conversation) MarkMessagesAsReadByMsgID

func (c *Conversation) MarkMessagesAsReadByMsgID(ctx context.Context, conversationID string, clientMsgIDs []string) error

deprecated

func (*Conversation) PinConversation

func (c *Conversation) PinConversation(ctx context.Context, conversationID string, isPinned bool) error

func (*Conversation) PullMessageBySeqs

func (c *Conversation) PullMessageBySeqs(ctx context.Context, seqs []*sdkws.SeqRange) (*sdkws.PullMessageBySeqsResp, error)

func (*Conversation) ResetConversationGroupAtType

func (c *Conversation) ResetConversationGroupAtType(ctx context.Context, conversationID string) error

func (*Conversation) RevokeMessage

func (c *Conversation) RevokeMessage(ctx context.Context, conversationID, clientMsgID string) error

func (*Conversation) SearchConversation added in v3.5.0

func (c *Conversation) SearchConversation(ctx context.Context, searchParam string) ([]*server_api_params.Conversation, error)

func (*Conversation) SendMessage

func (c *Conversation) SendMessage(ctx context.Context, s *sdk_struct.MsgStruct, recvID, groupID string, p *sdkws.OfflinePushInfo, isOnlineOnly bool) (*sdk_struct.MsgStruct, error)

func (*Conversation) SendMessageNotOss

func (c *Conversation) SendMessageNotOss(ctx context.Context, s *sdk_struct.MsgStruct, recvID, groupID string,
	p *sdkws.OfflinePushInfo, isOnlineOnly bool) (*sdk_struct.MsgStruct, error)

func (*Conversation) SetBatchMsgListener

func (c *Conversation) SetBatchMsgListener(batchMsgListener func() open_im_sdk_callback.OnBatchMsgListener)

func (*Conversation) SetConversationDraft

func (c *Conversation) SetConversationDraft(ctx context.Context, conversationID, draftText string) error

func (*Conversation) SetConversationIsMsgDestruct

func (c *Conversation) SetConversationIsMsgDestruct(ctx context.Context, conversationID string, isMsgDestruct bool) error

func (*Conversation) SetConversationListener

func (c *Conversation) SetConversationListener(listener func() open_im_sdk_callback.OnConversationListener)

func (*Conversation) SetConversationMsgDestructTime

func (c *Conversation) SetConversationMsgDestructTime(ctx context.Context, conversationID string, msgDestructTime int64) error

func (*Conversation) SetMessageLocalEx

func (c *Conversation) SetMessageLocalEx(ctx context.Context, conversationID string, clientMsgID string, localEx string) error

func (*Conversation) SetMessageReactionExtensions

func (c *Conversation) SetMessageReactionExtensions(ctx context.Context, s *sdk_struct.MsgStruct, req []*server_api_params.KeyValue) ([]*server_api_params.ExtensionResult, error)

func (*Conversation) SetMsgKvListener

func (c *Conversation) SetMsgKvListener(msgKvListener func() open_im_sdk_callback.OnMessageKvInfoListener)

func (*Conversation) SetMsgListener

func (c *Conversation) SetMsgListener(msgListener func() open_im_sdk_callback.OnAdvancedMsgListener)

func (*Conversation) SetOneConversationBurnDuration

func (c *Conversation) SetOneConversationBurnDuration(ctx context.Context, conversationID string, burnDuration int32) error

func (*Conversation) SetOneConversationEx added in v3.5.0

func (c *Conversation) SetOneConversationEx(ctx context.Context, conversationID string, ex string) error

func (*Conversation) SetOneConversationPrivateChat

func (c *Conversation) SetOneConversationPrivateChat(ctx context.Context, conversationID string, isPrivate bool) error

func (*Conversation) SetOneConversationRecvMessageOpt

func (c *Conversation) SetOneConversationRecvMessageOpt(ctx context.Context, conversationID string, opt int) error

func (*Conversation) SyncAllConversationHashReadSeqs

func (c *Conversation) SyncAllConversationHashReadSeqs(ctx context.Context) error

func (*Conversation) SyncAllConversations

func (c *Conversation) SyncAllConversations(ctx context.Context) error

func (*Conversation) SyncConversations

func (c *Conversation) SyncConversations(ctx context.Context, conversationIDs []string) error

func (*Conversation) SyncConversationsAndTriggerCallback

func (c *Conversation) SyncConversationsAndTriggerCallback(ctx context.Context, conversationsOnServer []*model_struct.LocalConversation) error

func (*Conversation) TypingStatusUpdate

func (c *Conversation) TypingStatusUpdate(ctx context.Context, recvID, msgTip string) error

func (*Conversation) Work

func (c *Conversation) Work(c2v common.Cmd2Value)

type InputStatesChangedData added in v3.5.1

type InputStatesChangedData struct {
	ConversationID string  `json:"conversationID"`
	UserID         string  `json:"userID"`
	PlatformIDs    []int32 `json:"platformIDs"`
}

type MaxSeqRecorder

type MaxSeqRecorder struct {
	// contains filtered or unexported fields
}

func NewMaxSeqRecorder

func NewMaxSeqRecorder() MaxSeqRecorder

func (*MaxSeqRecorder) Get

func (m *MaxSeqRecorder) Get(conversationID string) int64

func (*MaxSeqRecorder) Incr

func (m *MaxSeqRecorder) Incr(conversationID string, num int64)

func (*MaxSeqRecorder) IsNewMsg

func (m *MaxSeqRecorder) IsNewMsg(conversationID string, seq int64) bool

func (*MaxSeqRecorder) Set

func (m *MaxSeqRecorder) Set(conversationID string, seq int64)

type MessageController

type MessageController struct {
	// contains filtered or unexported fields
}

func NewMessageController

func NewMessageController(db db_interface.DataBase, ch chan common.Cmd2Value) *MessageController

func (*MessageController) BatchInsertMessageList

func (m *MessageController) BatchInsertMessageList(ctx context.Context, insertMsg map[string][]*model_struct.LocalChatLog) error

func (*MessageController) BatchUpdateMessageList

func (m *MessageController) BatchUpdateMessageList(ctx context.Context, updateMsg map[string][]*model_struct.LocalChatLog) error

func (*MessageController) SearchMessageByContentTypeAndKeyword

func (m *MessageController) SearchMessageByContentTypeAndKeyword(ctx context.Context, contentType []int, keywordList []string,
	keywordListMatchType int, startTime, endTime int64) (result []*model_struct.LocalChatLog, err error)

Jump to

Keyboard shortcuts

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