floo2
Public Types | Public Member Functions | Protected Member Functions | List of all members
floo::BMXChatService Class Referenceabstract

聊天Service More...

#include <bmx_chat_service.h>

Public Types

enum  ThumbnailStrategy { ThumbnailStrategy::ThirdpartyServerCreate = 1, ThumbnailStrategy::LocalServerCreate }
 缩略图生成策略, More...
 

Public Member Functions

virtual void sendMessage (BMXMessagePtr msg)=0
 发送消息,消息状态变化会通过listener通知 More...
 
virtual void resendMessage (BMXMessagePtr msg)=0
 重新发送消息,消息状态变化会通过listener通知 More...
 
virtual void recallMessage (BMXMessagePtr msg)=0
 撤回消息,消息状态变化会通过listener通知 More...
 
virtual BMXErrorCode forwardMessage (const BMXMessageList &list, BMXConversationPtr to, BMXMessagePtr &newMsg)=0
 合并转发消息 More...
 
virtual void forwardMessage (BMXMessagePtr msg)=0
 简单转发消息,用户应当通过BMXMessage::createForwardMessage()先创建转发消息 More...
 
virtual void ackMessage (BMXMessagePtr msg)=0
 发送已读回执 More...
 
virtual void ackPlayMessage (BMXMessagePtr msg)=0
 发送音频/视频消息已播放回执 More...
 
virtual void readCancel (BMXMessagePtr msg)=0
 标记此消息为未读,该消息同步到当前用户的所有设备 More...
 
virtual void readAllMessage (BMXMessagePtr msg)=0
 标记此消息及之前全部消息为已读,该消息同步到当前用户的所有设备 More...
 
virtual void removeMessage (BMXMessagePtr msg, bool synchronize=true)=0
 删除此消息,该消息同步到当前用户的其它设备 More...
 
virtual void downloadThumbnail (BMXMessagePtr msg, ThumbnailStrategy strategy=ThumbnailStrategy::ThirdpartyServerCreate)=0
 下载缩略图,下载状态变化和进度通过listener通知 缩略图生成策略,1 - 第三方服务器生成, 2 - 本地服务器生成,默认值是 1。 More...
 
virtual void downloadAttachment (BMXMessagePtr msg)=0
 下载附件,下载状态变化和进度通过listener通知 More...
 
virtual void downloadAttachmentByUrl (int64_t msgId, const std::string &url, const std::string &path)=0
 
virtual void cancelUploadAttachment (BMXMessagePtr msg)=0
 取消上传附件 More...
 
virtual void cancelDownloadAttachment (BMXMessagePtr msg)=0
 取消下载附件 More...
 
virtual BMXErrorCode insertMessages (const BMXMessageList &list)=0
 插入消息 More...
 
virtual BMXMessagePtr getMessage (int64_t msgId)=0
 读取一条消息 More...
 
virtual void deleteConversation (int64_t conversationId, bool synchronize=false)=0
 删除会话 More...
 
virtual BMXConversationPtr openConversation (int64_t conversationId, BMXConversation::Type type, bool createIfNotExist=true)=0
 打开一个会话 More...
 
virtual std::string attachmentDir ()=0
 获取附件保存路径 More...
 
virtual std::string attachmentDirForConversation (int64_t conversationId)=0
 获取会话的附件保存路径 More...
 
virtual BMXConversationList getAllConversations ()=0
 获取所有会话 More...
 
virtual int getAllConversationsUnreadCount ()=0
 获取所有会话的全部未读数(标记为屏蔽的个人和群组的未读数不统计在内) More...
 
virtual BMXErrorCode retrieveHistoryMessages (BMXConversationPtr conversation, int64_t refMsgId, size_t size, BMXMessageList &result)=0
 拉取历史消息 More...
 
virtual BMXErrorCode searchMessagesByKeyWords (const std::string &keywords, int64_t refTime, size_t size, std::vector< BMXMessageList > &result, BMXConversation::Direction=BMXConversation::Direction::Up)=0
 使用关键字搜索消息 More...
 
virtual BMXErrorCode searchMessages (const std::string &keywords, int64_t refTime, size_t size, std::vector< BMXMessageList > &result, BMXConversation::Direction=BMXConversation::Direction::Up)=0
 搜索消息 More...
 
virtual BMXErrorCode getGroupAckMessageUserIdList (BMXMessagePtr msg, std::vector< int64_t > &groupMemberIdList)=0
 获取发送的群组消息已读用户id列表 More...
 
virtual BMXErrorCode getGroupAckMessageUnreadUserIdList (BMXMessagePtr msg, std::vector< int64_t > &groupMemberIdList)=0
 获取发送的群组消息未读用户id列表 More...
 
virtual BMXErrorCode getGroupPlayAckMessageUserIdList (BMXMessagePtr msg, std::vector< int64_t > &groupMemberIdList)=0
 获取发送的群组音频/视频消息已播放用户id列表(仅用于音频/视频消息) More...
 
virtual BMXErrorCode getGroupUnPlayAckMessageUserIdList (BMXMessagePtr msg, std::vector< int64_t > &groupMemberIdList)=0
 获取发送的群组音频/视频消息未播放用户id列表(仅用于音频/视频消息) More...
 
virtual void addChatListener (BMXChatServiceListener *listener)=0
 添加聊天监听者 More...
 
virtual void removeChatListener (BMXChatServiceListener *listener)=0
 移除聊天监听者 More...
 

Protected Member Functions

void updateMessageId (BMXMessagePtr msg, int64_t newId)
 

Detailed Description

聊天Service

Member Enumeration Documentation

◆ ThumbnailStrategy

缩略图生成策略,

Enumerator
ThirdpartyServerCreate 

第三方服务器生成

LocalServerCreate 

本地服务器生成

Member Function Documentation

◆ ackMessage()

virtual void floo::BMXChatService::ackMessage ( BMXMessagePtr  msg)
pure virtual

发送已读回执

Parameters
msg需要发送已读回执的消息

◆ ackPlayMessage()

virtual void floo::BMXChatService::ackPlayMessage ( BMXMessagePtr  msg)
pure virtual

发送音频/视频消息已播放回执

Parameters
msg需要发送已读回执的消息

◆ addChatListener()

virtual void floo::BMXChatService::addChatListener ( BMXChatServiceListener listener)
pure virtual

添加聊天监听者

Parameters
listener聊天监听者

◆ attachmentDir()

virtual std::string floo::BMXChatService::attachmentDir ( )
pure virtual

获取附件保存路径

Returns
std::string

◆ attachmentDirForConversation()

virtual std::string floo::BMXChatService::attachmentDirForConversation ( int64_t  conversationId)
pure virtual

获取会话的附件保存路径

Parameters
conversationId需要获取会话附件路径的会话id
Returns
std::string

◆ cancelDownloadAttachment()

virtual void floo::BMXChatService::cancelDownloadAttachment ( BMXMessagePtr  msg)
pure virtual

取消下载附件

Parameters
msg需要取消下载附件的消息

◆ cancelUploadAttachment()

virtual void floo::BMXChatService::cancelUploadAttachment ( BMXMessagePtr  msg)
pure virtual

取消上传附件

Parameters
msg需要取消上传附件的消息

◆ deleteConversation()

virtual void floo::BMXChatService::deleteConversation ( int64_t  conversationId,
bool  synchronize = false 
)
pure virtual

删除会话

Parameters
conversationId需要删除会话的会话id
synchronize是否同步删除其它设备该会话,默认为false,仅删除本设备会话

◆ downloadAttachment()

virtual void floo::BMXChatService::downloadAttachment ( BMXMessagePtr  msg)
pure virtual

下载附件,下载状态变化和进度通过listener通知

Parameters
msg需要下载附件的消息

◆ downloadAttachmentByUrl()

virtual void floo::BMXChatService::downloadAttachmentByUrl ( int64_t  msgId,
const std::string &  url,
const std::string &  path 
)
pure virtual

下载附件,下载状态变化和进度通过listener通知

◆ downloadThumbnail()

virtual void floo::BMXChatService::downloadThumbnail ( BMXMessagePtr  msg,
ThumbnailStrategy  strategy = ThumbnailStrategy::ThirdpartyServerCreate 
)
pure virtual

下载缩略图,下载状态变化和进度通过listener通知 缩略图生成策略,1 - 第三方服务器生成, 2 - 本地服务器生成,默认值是 1。

Parameters
msg需要下载缩略图的消息
strategy缩略图生成策略,1 - 第三方服务器生成, 2 - 本地服务器生成,默认值是 1。

◆ forwardMessage() [1/2]

virtual BMXErrorCode floo::BMXChatService::forwardMessage ( const BMXMessageList &  list,
BMXConversationPtr  to,
BMXMessagePtr &  newMsg 
)
pure virtual

合并转发消息

Parameters
list转发的消息列表
to消息被转发到的会话
newMsg转发的消息列表合并后生成的新的单条转发消息
Returns
BMXErrorCode

◆ forwardMessage() [2/2]

virtual void floo::BMXChatService::forwardMessage ( BMXMessagePtr  msg)
pure virtual

简单转发消息,用户应当通过BMXMessage::createForwardMessage()先创建转发消息

Parameters
msg转发的消息

◆ getAllConversations()

virtual BMXConversationList floo::BMXChatService::getAllConversations ( )
pure virtual

获取所有会话

Returns
BMXConversationList

◆ getAllConversationsUnreadCount()

virtual int floo::BMXChatService::getAllConversationsUnreadCount ( )
pure virtual

获取所有会话的全部未读数(标记为屏蔽的个人和群组的未读数不统计在内)

Returns
int

◆ getGroupAckMessageUnreadUserIdList()

virtual BMXErrorCode floo::BMXChatService::getGroupAckMessageUnreadUserIdList ( BMXMessagePtr  msg,
std::vector< int64_t > &  groupMemberIdList 
)
pure virtual

获取发送的群组消息未读用户id列表

Parameters
msg需要获取未读用户id列表的消息
groupMemberIdList对该条消息未读的用户id列表,初始传入为空列表
Returns
BMXErrorCode

◆ getGroupAckMessageUserIdList()

virtual BMXErrorCode floo::BMXChatService::getGroupAckMessageUserIdList ( BMXMessagePtr  msg,
std::vector< int64_t > &  groupMemberIdList 
)
pure virtual

获取发送的群组消息已读用户id列表

Parameters
msg需要获取已读用户id列表的消息
groupMemberIdList对该条消息已读的用户id列表,初始传入为空列表
Returns
BMXErrorCode

◆ getGroupPlayAckMessageUserIdList()

virtual BMXErrorCode floo::BMXChatService::getGroupPlayAckMessageUserIdList ( BMXMessagePtr  msg,
std::vector< int64_t > &  groupMemberIdList 
)
pure virtual

获取发送的群组音频/视频消息已播放用户id列表(仅用于音频/视频消息)

Parameters
msg需要获取已播放用户id列表的消息
groupMemberIdList对该条消息已播放的用户id列表,初始传入为空列表
Returns
BMXErrorCode

◆ getGroupUnPlayAckMessageUserIdList()

virtual BMXErrorCode floo::BMXChatService::getGroupUnPlayAckMessageUserIdList ( BMXMessagePtr  msg,
std::vector< int64_t > &  groupMemberIdList 
)
pure virtual

获取发送的群组音频/视频消息未播放用户id列表(仅用于音频/视频消息)

Parameters
msg需要获取未播放用户id列表的消息
groupMemberIdList对该条消息未播放的用户id列表,初始传入为空列表
Returns
BMXErrorCode

◆ getMessage()

virtual BMXMessagePtr floo::BMXChatService::getMessage ( int64_t  msgId)
pure virtual

读取一条消息

Parameters
msgId需要获取消息的消息id
Returns
BMXMessagePtr

◆ insertMessages()

virtual BMXErrorCode floo::BMXChatService::insertMessages ( const BMXMessageList &  list)
pure virtual

插入消息

Parameters
list插入消息列表
Returns
BMXErrorCode

◆ openConversation()

virtual BMXConversationPtr floo::BMXChatService::openConversation ( int64_t  conversationId,
BMXConversation::Type  type,
bool  createIfNotExist = true 
)
pure virtual

打开一个会话

Parameters
conversationId需要打开的会话的会话id
type会话的类型,单聊还是群聊。
createIfNotExist会话不存在的情况下是否要创建本地会话,默认为创建
Returns
BMXConversationPtr

◆ readAllMessage()

virtual void floo::BMXChatService::readAllMessage ( BMXMessagePtr  msg)
pure virtual

标记此消息及之前全部消息为已读,该消息同步到当前用户的所有设备

Parameters
msg需要标记为此消息以前全部消息为已读的消息

◆ readCancel()

virtual void floo::BMXChatService::readCancel ( BMXMessagePtr  msg)
pure virtual

标记此消息为未读,该消息同步到当前用户的所有设备

Parameters
msg需要发送消息已读取消的消息

◆ recallMessage()

virtual void floo::BMXChatService::recallMessage ( BMXMessagePtr  msg)
pure virtual

撤回消息,消息状态变化会通过listener通知

Parameters
msg撤回的消息

◆ removeChatListener()

virtual void floo::BMXChatService::removeChatListener ( BMXChatServiceListener listener)
pure virtual

移除聊天监听者

Parameters
listener聊天监听者

◆ removeMessage()

virtual void floo::BMXChatService::removeMessage ( BMXMessagePtr  msg,
bool  synchronize = true 
)
pure virtual

删除此消息,该消息同步到当前用户的其它设备

Parameters
msg需要删除的消息
synchronize是否同步到其它设备,不同步的情况下只会删除本地存储的该条消息

◆ resendMessage()

virtual void floo::BMXChatService::resendMessage ( BMXMessagePtr  msg)
pure virtual

重新发送消息,消息状态变化会通过listener通知

Parameters
msg重新发送的消息

◆ retrieveHistoryMessages()

virtual BMXErrorCode floo::BMXChatService::retrieveHistoryMessages ( BMXConversationPtr  conversation,
int64_t  refMsgId,
size_t  size,
BMXMessageList &  result 
)
pure virtual

拉取历史消息

Parameters
conversation需要拉取历史消息的会话
refMsgId拉取会话消息的起始消息Id
size拉取的最大消息条数
result拉取操作获取的消息列表,外部初始化传入空列表。
Returns
BMXErrorCode

◆ searchMessages()

virtual BMXErrorCode floo::BMXChatService::searchMessages ( const std::string &  keywords,
int64_t  refTime,
size_t  size,
std::vector< BMXMessageList > &  result,
BMXConversation::Direction  = BMXConversation::Direction::Up 
)
pure virtual

搜索消息

Deprecated. use searchMessagesByKeyWords instead.

Parameters
keywords搜索的关键字
refTime搜索消息的起始时间
size搜索的最大消息条数
result搜索到的消息结果列表,外部初始化传入空列表。
Direction消息搜索方向,默认(Direction::Up)是从更早的消息中搜索
Returns
BMXErrorCode

◆ searchMessagesByKeyWords()

virtual BMXErrorCode floo::BMXChatService::searchMessagesByKeyWords ( const std::string &  keywords,
int64_t  refTime,
size_t  size,
std::vector< BMXMessageList > &  result,
BMXConversation::Direction  = BMXConversation::Direction::Up 
)
pure virtual

使用关键字搜索消息

Parameters
keywords搜索的关键字
refTime搜索消息的起始时间
size搜索的最大消息条数
result搜索到的消息结果列表,外部初始化传入空列表。
Direction消息搜索方向,默认(Direction::Up)是从更早的消息中搜索
Returns
BMXErrorCode

◆ sendMessage()

virtual void floo::BMXChatService::sendMessage ( BMXMessagePtr  msg)
pure virtual

发送消息,消息状态变化会通过listener通知

Parameters
msg发送的消息

The documentation for this class was generated from the following file: