conversation_msg

package
v3.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const InitSyncProgress = 10

InitSyncProgress is initialize Sync when reinstall.

Variables

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

Functions

func LocalChatLogToMsgStruct added in v3.8.2

func LocalChatLogToMsgStruct(localMessage *model_struct.LocalChatLog) *sdk_struct.MsgStruct

func LocalConversationToServer

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

func MsgDataToLocalChatLog added in v3.8.2

func MsgDataToLocalChatLog(serverMessage *sdkws.MsgData) *model_struct.LocalChatLog

func MsgStructToLocalChatLog added in v3.8.2

func MsgStructToLocalChatLog(message *sdk_struct.MsgStruct) *model_struct.LocalChatLog

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, relation *relation.Relation, group *group.Group, user *user.User,
	file *file.File) *Conversation

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) DeleteAllMsgFromLocalAndServer added in v3.8.1

func (c *Conversation) DeleteAllMsgFromLocalAndServer(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

func (*Conversation) DoConversationChangedNotification

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

func (*Conversation) DoConversationIsPrivateChangedNotification

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

func (*Conversation) DoMsgReaction

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

func (*Conversation) DoNotification added in v3.8.0

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

func (*Conversation) FetchSurroundingMessages added in v3.8.2

func (c *Conversation) FetchSurroundingMessages(ctx context.Context, conversationID string, seq int64, before int64, after int64) ([]*sdk_struct.MsgStruct, error)

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) GetInputStates added in v3.5.1

func (c *Conversation) GetInputStates(ctx context.Context, conversationID string, userID string) ([]int32, 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)

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) IncrSyncConversations added in v3.8.0

func (c *Conversation) IncrSyncConversations(ctx context.Context) 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)

func (*Conversation) LocalChatLog2MsgStruct added in v3.8.2

func (c *Conversation) LocalChatLog2MsgStruct(ctx context.Context, list []*model_struct.LocalChatLog) (int64, []*sdk_struct.MsgStruct)

func (*Conversation) MarkAllConversationMessageAsRead added in v3.8.2

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

func (*Conversation) MarkConversationMessageAsRead

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

func (*Conversation) MarkMessagesAsReadByMsgID

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

deprecated

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) SetBusinessListener added in v3.8.1

func (c *Conversation) SetBusinessListener(businessListener func() open_im_sdk_callback.OnCustomBusinessListener)

func (*Conversation) SetConversation added in v3.8.1

func (c *Conversation) SetConversation(ctx context.Context, conversationID string, req *pbConversation.ConversationReq) error

func (*Conversation) SetConversationDraft

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

func (*Conversation) SetConversationListener

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

func (*Conversation) SetMessageLocalEx

func (c *Conversation) SetMessageLocalEx(ctx context.Context, conversationID string, clientMsgID string, localEx string) 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) SyncAllConversationHashReadSeqs

func (c *Conversation) SyncAllConversationHashReadSeqs(ctx context.Context) 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)

Jump to

Keyboard shortcuts

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