im::floo::floolib::BMXChatManager
Chat manager
Public Functions
Name | |
---|---|
BMXChatManager(BMXChatService service) | |
void | sendMessage(final BMXMessage msg) Send a message, and the message status change is notified via listener |
void | resendMessage(final BMXMessage msg) Resend this message, and the message status change is notified via listener |
void | recallMessage(final BMXMessage msg) Recall a message, and the message status change is notified via listener |
void | forwardMessage(final BMXMessageList list, final BMXConversation to, final BMXMessage newMsg, final BMXCallBack callBack) Merge and forward messages |
void | forwardMessage(final BMXMessage msg) Simple forwarding messages, users should create forwarding messages first through BMXMessage:: createForwardMessage () |
void | readAllMessage(final BMXMessage msg) Mark this message and all previous messages as read, and synchronize to all current users' devices |
void | removeMessage(final BMXMessage msg, final boolean synchronize) Delete this message, which synchronizes to other devices of the current user |
void | removeMessage(final BMXMessage msg) |
void | ackMessage(final BMXMessage msg) Send read acknowledgement |
void | readCancel(final BMXMessage msg) Set unread |
void | downloadThumbnail(final BMXMessage msg) Download thumbnail, downloading state changes and progress notified via listener. Thumbnail generation policy: 1 - generated by third-party server, 2 - generated by local server, default 1. |
void | downloadAttachment(final BMXMessage msg) Downloaded attachments, and download state changes and progress are notified via listener |
void | cancelDownloadAttachment(final BMXMessage msg) Cancel attachment downloading |
int | transferingNum() Number of uploading/downloading files |
void | insertMessages(final BMXMessageList list, final BMXCallBack callBack) Insert a message |
void | getMessage(final long msgId, final BMXDataCallBack< BMXMessage > callBack) Read a message |
void | deleteConversation(final long conversationId, final Boolean sync) Delete a conversation |
void | openConversation(final long conversationId, final BMXConversation.Type type, final boolean createIfNotExist, final BMXDataCallBack< BMXConversation > callBack) Launch a conversation |
void | getAllConversations(final BMXDataCallBack< BMXConversationList > callBack) Get all conversations |
void | getAllConversationsUnreadCount(final BMXDataCallBack< Integer > callBack) Get number of unread messages for all conversations (unreads for individuals and groups marked as blocked is not counted) |
void | retrieveHistoryMessages(final BMXConversation conversation, final long refMsgId, final long size, final BMXDataCallBack< BMXMessageList > callBack) Pull message history |
void | searchMessages(final String keywords, final long refTime, final long size, final BMXConversation.Direction arg4, final BMXDataCallBack< BMXMessageListList > callBack) Search for messages |
void | searchMessages(final String keywords, final long refTime, final long size, final BMXDataCallBack< BMXMessageListList > callBack) |
void | getGroupAckMessageUserIdList(final BMXMessage msg, final BMXDataCallBack< ListOfLongLong > callBack) Get the list of user-ids that have read group messages |
void | addChatListener(BMXChatServiceListener listener) Add chat listener |
void | removeChatListener(BMXChatServiceListener listener) Remove chat listener |
Public Functions Documentation
function BMXChatManager
inline BMXChatManager(
BMXChatService service
)
Example:
function sendMessage
inline void sendMessage(
final BMXMessage msg
)
Send a message, and the message status change is notified via listener
Parameters:
- msg Message to be sent
Example:
public void sendMessage(BMXMessage msg) {
mService.sendMessage(msg);
function resendMessage
inline void resendMessage(
final BMXMessage msg
)
Resend this message, and the message status change is notified via listener
Parameters:
- msg Resent message
Example:
public void resendMessage(BMXMessage msg) {
mService.resendMessage(msg);
function recallMessage
inline void recallMessage(
final BMXMessage msg
)
Recall a message, and the message status change is notified via listener
Parameters:
- msg Recalled message
Example:
public void recallMessage(BMXMessage msg) {
mService.recallMessage(msg);
function forwardMessage
inline void forwardMessage(
final BMXMessageList list,
final BMXConversation to,
final BMXMessage newMsg,
final BMXCallBack callBack
)
Merge and forward messages
Parameters:
- list List of messages to be forwarded
- to The conversation to which message is forwarded
- newMsg The newly generated single forwarded message from the merging list of messages to be forwarded
- callBack [BMXErrorCode]
Example:
public void forwardMessage(BMXMessageList list, BMXConversation to, BMXMessage newMsg, BMXCallBack callBack) {
mService.forwardMessage(list, to, newMsg, callBack);
public void forwardMessage(BMXMessage msg) {
mService.forwardMessage(msg);
function forwardMessage
inline void forwardMessage(
final BMXMessage msg
)
Simple forwarding messages, users should create forwarding messages first through BMXMessage:: createForwardMessage ()
Parameters:
- msg Messages to be forwarded
Example:
public void forwardMessage(BMXMessageList list, BMXConversation to, BMXMessage newMsg, BMXCallBack callBack) {
mService.forwardMessage(list, to, newMsg, callBack);
public void forwardMessage(BMXMessage msg) {
mService.forwardMessage(msg);
function readAllMessage
inline void readAllMessage(
final BMXMessage msg
)
Mark this message and all previous messages as read, and synchronize to all current users' devices
Parameters:
- msg The message for which all earlier messages need to be marked as read
Example:
public void readAllMessage(BMXMessage msg) {
mService.readAllMessage(msg);
function removeMessage
inline void removeMessage(
final BMXMessage msg,
final boolean synchronize
)
Delete this message, which synchronizes to other devices of the current user
Parameters:
- msg Message to be deleted
- synchronize Whether to synchronize to other devices, otherwise only the locally stored message will be deleted
Example:
public void removeMessage(BMXMessage msg, boolean synchronize) {
mService.removeMessage(msg, synchronize);
public void removeMessage(BMXMessage msg) {
mService.removeMessage(msg);
function removeMessage
inline void removeMessage(
final BMXMessage msg
)
Example:
public void removeMessage(BMXMessage msg, boolean synchronize) {
mService.removeMessage(msg, synchronize);
public void removeMessage(BMXMessage msg) {
mService.removeMessage(msg);
function ackMessage
inline void ackMessage(
final BMXMessage msg
)
Send read acknowledgement
Example:
public void ackMessage(BMXMessage msg) {
mService.ackMessage(msg);
function readCancel
inline void readCancel(
final BMXMessage msg
)
Set unread
Example:
public void readCancel(BMXMessage msg) {
mService.readCancel(msg);
function downloadThumbnail
inline void downloadThumbnail(
final BMXMessage msg
)
Download thumbnail, downloading state changes and progress notified via listener. Thumbnail generation policy: 1 - generated by third-party server, 2 - generated by local server, default 1.
Parameters:
- msg Message requiring to download thumbnail
Example:
public void downloadThumbnail(BMXMessage msg) {
mService.downloadThumbnail(msg);
function downloadAttachment
inline void downloadAttachment(
final BMXMessage msg
)
Downloaded attachments, and download state changes and progress are notified via listener
Parameters:
- msg Message requiring to download attachment
Example:
public void downloadAttachment(BMXMessage msg) {
mService.downloadAttachment(msg);
function cancelDownloadAttachment
inline void cancelDownloadAttachment(
final BMXMessage msg
)
Cancel attachment downloading
Parameters:
- msg Message requiring to download attachment
Example:
public void cancelDownloadAttachment(BMXMessage msg) {
mService.cancelDownloadAttachment(msg);
function transferingNum
inline int transferingNum()
Number of uploading/downloading files
Return: Number of files in transfer
Example:
public int transferingNum() {
return mService.transferingNum();
function insertMessages
inline void insertMessages(
final BMXMessageList list,
final BMXCallBack callBack
)
Insert a message
Parameters:
- list Insert message list
- callBack [BMXErrorCode]
Example:
public void insertMessages(BMXMessageList list, BMXCallBack callBack) {
mService.insertMessages(list, callBack);
function getMessage
inline void getMessage(
final long msgId,
final BMXDataCallBack< BMXMessage > callBack
)
Read a message
Parameters:
- msgId id of the message which needs to be fetched
- callBack BMXMessage
Example:
public void getMessage(long msgId, BMXDataCallBack<BMXMessage> callBack) {
mService.getMessage(msgId, callBack);
function deleteConversation
inline void deleteConversation(
final long conversationId,
final Boolean sync
)
Delete a conversation
Parameters:
- conversationId Conversation id requiring to delete conversation
- sync Whether to delete the conversation on other devices synchronously, default false, means only delete the conversation on the current device
Example:
public void deleteConversation(long conversationId, Boolean sync) {
mService.deleteConversation(conversationId, sync);
function openConversation
inline void openConversation(
final long conversationId,
final BMXConversation.Type type,
final boolean createIfNotExist,
final BMXDataCallBack< BMXConversation > callBack
)
Launch a conversation
Parameters:
- conversationId id of the conversation which needs to be opened
- type Conversation type, single/group chat.
- createIfNotExist Whether to create a local conversation if no conversation existing, default to create
- callBack BMXConversation
Example:
public void openConversation(long conversationId, BMXConversation.Type type,
boolean createIfNotExist, BMXDataCallBack<BMXConversation> callBack) {
mService.openConversation(conversationId, type, createIfNotExist, callBack);
function getAllConversations
inline void getAllConversations(
final BMXDataCallBack< BMXConversationList > callBack
)
Get all conversations
Parameters:
- callBack BMXConversationList
Example:
public void getAllConversations(BMXDataCallBack<BMXConversationList> callBack) {
mService.getAllConversations(callBack);
function getAllConversationsUnreadCount
inline void getAllConversationsUnreadCount(
final BMXDataCallBack< Integer > callBack
)
Get number of unread messages for all conversations (unreads for individuals and groups marked as blocked is not counted)
Parameters:
- callBack Number of unreads
Example:
public void getAllConversationsUnreadCount(BMXDataCallBack<Integer> callBack) {
mService.getAllConversationsUnreadCount(callBack);
function retrieveHistoryMessages
inline void retrieveHistoryMessages(
final BMXConversation conversation,
final long refMsgId,
final long size,
final BMXDataCallBack< BMXMessageList > callBack
)
Pull message history
Parameters:
- conversation Conversation for which message history needs to pull
- refMsgId Start message Id for pulling conversation messages
- size Maximum number of messages to pull
- callBack BMXErrorCode,Message list obtained by pull
Example:
public void retrieveHistoryMessages(BMXConversation conversation, long refMsgId, long size, BMXDataCallBack<BMXMessageList> callBack) {
mService.retrieveHistoryMessages(conversation, refMsgId, size, callBack);
function searchMessages
inline void searchMessages(
final String keywords,
final long refTime,
final long size,
final BMXConversation.Direction arg4,
final BMXDataCallBack< BMXMessageListList > callBack
)
Search for messages
Parameters:
- keywords Keyword for search
- refTime Start time of message search
- size Maximum number of messages to search
- arg4 Message search direction, default (Direction::Up)means search from earlier messages.
- callBack BMXErrorCode,List of searched message results
Example:
public void searchMessages(String keywords, long refTime, long size,
BMXDataCallBack<BMXMessageListList> callBack) {
mService.searchMessages(keywords, refTime, size, callBack);
function searchMessages
inline void searchMessages(
final String keywords,
final long refTime,
final long size,
final BMXDataCallBack< BMXMessageListList > callBack
)
Example:
public void searchMessages(String keywords, long refTime, long size,
BMXDataCallBack<BMXMessageListList> callBack) {
mService.searchMessages(keywords, refTime, size, callBack);
function getGroupAckMessageUserIdList
inline void getGroupAckMessageUserIdList(
final BMXMessage msg,
final BMXDataCallBack< ListOfLongLong > callBack
)
Get the list of user-ids that have read group messages
Parameters:
- msg Message requiring to get list of read user ids
- callBack [BMXErrorCode], list of user ids that have read this message
Example:
public void getGroupAckMessageUserIdList(BMXMessage msg,
BMXDataCallBack<ListOfLongLong> callBack) {
mService.getGroupAckMessageUserIdList(msg, callBack);
function addChatListener
inline void addChatListener(
BMXChatServiceListener listener
)
Add chat listener
Parameters:
- listener Chat listener
Example:
public void addChatListener(BMXChatServiceListener listener) {
mService.addChatListener(listener);
function removeChatListener
inline void removeChatListener(
BMXChatServiceListener listener
)
Remove chat listener
Parameters:
- listener Chat listener
Example:
public void removeChatListener(BMXChatServiceListener listener) {
mService.removeChatListener(listener);
Updated on 2022-01-26 at 17:18:31 +0800