agora_chat_SDK 1.0.6
agora java chat SDK
|
Public Member Functions | |
void | sendMessage (final ChatMessage msg) |
void | ackConversationRead (String conversationId) throws ChatException |
void | ackMessageRead (String to, String messageId) throws ChatException |
void | ackGroupMessageRead (String to, String messageId, String ext) throws ChatException |
void | recallMessage (ChatMessage message) throws ChatException |
void | aysncRecallMessage (final ChatMessage message, final CallBack callback) |
ChatMessage | getMessage (String messageId) |
Conversation | getConversation (String id) |
Conversation | getConversation (String id, ConversationType type) |
Conversation | getConversation (String username, ConversationType type, boolean createIfNotExists) |
Conversation | getConversation (String username, ConversationType type, boolean createIfNotExists, boolean isChatThread) |
void | markAllConversationsAsRead () |
int | getUnreadMsgsCount () |
int | getUnreadMessageCount () |
void | saveMessage (ChatMessage message) |
boolean | updateMessage (ChatMessage message) |
void | downloadAttachment (final ChatMessage msg) |
void | downloadThumbnail (final ChatMessage msg) |
synchronized void | importMessages (List< ChatMessage > msgs) |
List< Conversation > | getConversationsByType (ConversationType type) |
void | downloadFile (final String remoteUrl, final String localFilePath, final Map< String, String > headers, final CallBack callback) |
Map< String, Conversation > | getAllConversations () |
Map< String, Conversation > | fetchConversationsFromServer () throws ChatException |
void | asyncFetchConversationsFromServer (final ValueCallBack< Map< String, Conversation > > callBack) |
void | loadAllConversations () |
boolean | deleteConversation (String username, boolean deleteMessages) |
void | deleteConversationFromServer (String username, ConversationType type, boolean isDeleteServerMessages, CallBack deleteCallBack) |
void | addMessageListener (MessageListener listener) |
void | removeMessageListener (MessageListener listener) |
void | addConversationListener (ConversationListener listener) |
void | removeConversationListener (ConversationListener listener) |
void | setMessageListened (ChatMessage message) |
void | setVoiceMessageListened (ChatMessage message) |
boolean | updateParticipant (String from, String changeTo) |
CursorResult< GroupReadAck > | fetchGroupReadAcks (String msgId, int pageSize, String startAckId) throws ChatException |
void | asyncFetchGroupReadAcks (final String msgId, final int pageSize, final String startAckId, final ValueCallBack< CursorResult< GroupReadAck > > callBack) |
CursorResult< ChatMessage > | fetchHistoryMessages (String conversationId, ConversationType type, int pageSize, String startMsgId) throws ChatException |
CursorResult< ChatMessage > | fetchHistoryMessages (String conversationId, ConversationType type, int pageSize, String startMsgId, Conversation.SearchDirection direction) throws ChatException |
void | asyncFetchHistoryMessage (final String conversationId, final ConversationType type, final int pageSize, final String startMsgId, final ValueCallBack< CursorResult< ChatMessage > > callBack) |
void | asyncFetchHistoryMessage (final String conversationId, final ConversationType type, final int pageSize, final String startMsgId, final Conversation.SearchDirection direction, final ValueCallBack< CursorResult< ChatMessage > > callBack) |
List< ChatMessage > | searchMsgFromDB (ChatMessage.Type type, long timeStamp, int maxCount, String from, Conversation.SearchDirection direction) |
List< ChatMessage > | searchMsgFromDB (String keywords, long timeStamp, int maxCount, String from, Conversation.SearchDirection direction) |
void | deleteMessagesBeforeTimestamp (long timeStamp, CallBack callback) |
void | asyncReportMessage (String msgId, String reportTarget, String reportReason, CallBack callBack) |
void | reportMessage (String msgId, String reportTarget, String reportReason) throws ChatException |
void | fetchSupportLanguages (ValueCallBack< List< Language > > callBack) |
void | translateMessage (ChatMessage message, List< String > languages, ValueCallBack< ChatMessage > callBack) |
void | addReaction (final String messageId, final String reaction) throws ChatException |
void | asyncAddReaction (final String messageId, final String reaction, final CallBack callback) |
void | removeReaction (final String messageId, final String reaction) throws ChatException |
void | asyncRemoveReaction (final String messageId, final String reaction, final CallBack callback) |
Map< String, List< MessageReaction > > | getReactionList (final List< String > messageIdList, final ChatMessage.ChatType chatType, final String groupId) throws ChatException |
void | asyncGetReactionList (final List< String > messageIdList, final ChatMessage.ChatType chatType, final String groupId, final ValueCallBack< Map< String, List< MessageReaction > > > callback) |
CursorResult< MessageReaction > | getReactionDetail (final String messageId, final String reaction, final String cursor, final int pageSize) throws ChatException |
void | asyncGetReactionDetail (final String messageId, final String reaction, final String cursor, final int pageSize, final ValueCallBack< CursorResult< MessageReaction > > callback) |
Protected Member Functions | |
ChatManager (ChatClient client, EMAChatManager manager, EMAReactionManager reactionManager) | |
The chat manager. This class is responsible for managing conversations. (such as: load, delete), sending messages, downloading attachments and so on.
Such as, send a text message:
void io.agora.chat.ChatManager.ackConversationRead | ( | String | conversationId | ) | throws ChatException |
Sends the conversation read receipt to the server. This method is only for one-to-one chat conversation.
This method will inform the sever to set the unread message count of the conversation to 0, and conversationist (with multiple devices) will receive a callback method from ConversationListener#onConversationRead(String, String).
Reference: If you want to send group message read receipt to the sever, see ackGroupMessageRead(String, String, String).
conversationId | The conversation ID. |
ChatException | The possible exceptions are as follows: Error#USER_NOT_LOGIN, Error#SERVER_NOT_REACHABLE, Error#MESSAGE_INVALID and so on, see Error. |
void io.agora.chat.ChatManager.ackGroupMessageRead | ( | String | to, |
String | messageId, | ||
String | ext | ||
) | throws ChatException |
Sends the group message receipt to the server.
You can only call the method after setting the following method: ChatOptions#setRequireAck(boolean) and ChatMessage#setIsNeedGroupAck(boolean).
Reference: To send the one-to-one chat message receipt to server, call ackMessageRead(String, String); To send the conversation receipt to the server, call ackConversationRead(String).
to | The conversation ID. |
messageId | The message ID. |
ext | The extension information. Developer self-defined command string that can be used for specifying custom action/command. |
ChatException | A description of the exception, see Error. |
void io.agora.chat.ChatManager.ackMessageRead | ( | String | to, |
String | messageId | ||
) | throws ChatException |
Sends the read receipt to the server.
This method applies to one-to-one chats only.
Warning This method only takes effect if you set ChatOptions#setRequireAck(boolean) as true
.
Reference: To send the group message read receipt, call ackGroupMessageRead(String, String, String).
We recommend that you call ackConversationRead(String) when entering a chat page, and call this method in other cases to reduce the number of method calls.
to | The receiver of the read receipt. |
messageId | The message ID. |
ChatException | A description of the exception, see Error. |
void io.agora.chat.ChatManager.addConversationListener | ( | ConversationListener | listener | ) |
Adds the conversation listener.
The method is used to listen the change of conversation and listen the receipt of the conversation message, see ConversationListener.
After set this method, if you want to remove the conversation listener, you can call the method of removeConversationListener(ConversationListener) to remove it.
listener | The conversation listener to be set, see ConversationListener. |
void io.agora.chat.ChatManager.addMessageListener | ( | MessageListener | listener | ) |
Adds the message listener.
Receives new messages and so on can set the method to listen, see MessageListener.
listener | The message listener which is used to listen the incoming messages, see MessageListener |
void io.agora.chat.ChatManager.addReaction | ( | final String | messageId, |
final String | reaction | ||
) | throws ChatException |
Adds a reaction.
This is a synchronous method and blocks the current thread.
messageId | The message ID. |
reaction | The reaction content. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.ChatManager.asyncAddReaction | ( | final String | messageId, |
final String | reaction, | ||
final CallBack | callback | ||
) |
Adds a reaction.
This is an asynchronous method.
messageId | The message ID. |
reaction | The message reaction. |
callback | The result callback which contains the error information if the method fails. |
void io.agora.chat.ChatManager.asyncFetchConversationsFromServer | ( | final ValueCallBack< Map< String, Conversation > > | callBack | ) |
Fetches conversations from the server. The default maximum return is 100.
This is an asynchronous method.
void io.agora.chat.ChatManager.asyncFetchGroupReadAcks | ( | final String | msgId, |
final int | pageSize, | ||
final String | startAckId, | ||
final ValueCallBack< CursorResult< GroupReadAck > > | callBack | ||
) |
Fetches the ack details for group messages from server.
Fetches by page.
Reference: If you want to send group message receipt, see ackConversationRead(String).
This is an asynchronous method.
msgId | The message ID. |
pageSize | The number of records per page. |
startAckId | The start ID for fetch receipts, can be null. If you set it as null, the SDK will start from the server's latest receipt. |
callBack | The result callback, if successful, the SDK will execute the method ValueCallBack#onSuccess(Object), if the call failed, the SDK will execute the method ValueCallBack#onError(int, String). |
void io.agora.chat.ChatManager.asyncFetchHistoryMessage | ( | final String | conversationId, |
final ConversationType | type, | ||
final int | pageSize, | ||
final String | startMsgId, | ||
final Conversation.SearchDirection | direction, | ||
final ValueCallBack< CursorResult< ChatMessage > > | callBack | ||
) |
Fetches the message history of the conversation from the server.
Fetches by page.
This is an asynchronous method.
conversationId | The conversation id which select to fetch roam message. |
type | The conversation type which select to fetch roam message. |
pageSize | The number of records per page. |
startMsgId | The start search roam message, if the param is empty, direction is io.agora.chat.Conversation.SearchDirection#UP , fetches from the server latest message, direction is io.agora.chat.Conversation.SearchDirection#DOWN , fetches from the server oldest message. |
direction | Roaming message retrieval direction, io.agora.chat.Conversation.SearchDirection#UP is the retrieval time stamp message less than the start message time stamp, io.agora.chat.Conversation.SearchDirection#DOWN is a message whose retrieval timestamp is greater than the timestamp of the start message. |
callBack | The result callback, if successful, the SDK will execute the method ValueCallBack#onSuccess(Object), which returns messages from server and cursor for next fetch action; if the call failed, the SDK will execute the method ValueCallBack#onError(int, String). |
void io.agora.chat.ChatManager.asyncFetchHistoryMessage | ( | final String | conversationId, |
final ConversationType | type, | ||
final int | pageSize, | ||
final String | startMsgId, | ||
final ValueCallBack< CursorResult< ChatMessage > > | callBack | ||
) |
Fetches the message history of the conversation from the server.
Fetches by page.
This is an asynchronous method.
conversationId | The conversation id which select to fetch roam message. |
type | The conversation type which select to fetch roam message. |
pageSize | The number of records per page. |
startMsgId | The start search roam message, if empty start from the server latest message. |
callBack | The result callback, if successful, the SDK will execute the method ValueCallBack#onSuccess(Object), which returns messages from server and cursor for next fetch action; if the call failed, the SDK will execute the method ValueCallBack#onError(int, String). |
void io.agora.chat.ChatManager.asyncGetReactionDetail | ( | final String | messageId, |
final String | reaction, | ||
final String | cursor, | ||
final int | pageSize, | ||
final ValueCallBack< CursorResult< MessageReaction > > | callback | ||
) |
Gets the reaction details.
This is an asynchronous method.
messageId | The message ID. |
reaction | The reaction content. |
cursor | The query cursor. |
pageSize | The number of Reactions you expect to get on each page. |
callback | The result callback, which contains the reaction list obtained from the server and the cursor for the next query. Returns null if all the data is fetched. |
void io.agora.chat.ChatManager.asyncGetReactionList | ( | final List< String > | messageIdList, |
final ChatMessage.ChatType | chatType, | ||
final String | groupId, | ||
final ValueCallBack< Map< String, List< MessageReaction > > > | callback | ||
) |
Gets the list of Reactions.
This is an asynchronous method.
messageIdList | The message ID. |
chatType | The chat type. Only one-to-one chat (ChatMessage.ChatType#Chat and group chat (ChatMessage.ChatType#GroupChat) are allowed. |
groupId | The group ID, which is invalid only when the chat type is group chat. |
callback | The result callback, which contains the Reaction list under the specified message ID(The user list of MessageReaction is the summary data, which only contains the information of the first three users). |
void io.agora.chat.ChatManager.asyncRemoveReaction | ( | final String | messageId, |
final String | reaction, | ||
final CallBack | callback | ||
) |
Deletes a reaction.
This is an asynchronous method.
messageId | The message ID. |
reaction | The reaction content. |
callback | The result callback which contains the error information if the method fails. |
void io.agora.chat.ChatManager.asyncReportMessage | ( | String | msgId, |
String | reportTarget, | ||
String | reportReason, | ||
CallBack | callBack | ||
) |
Report violation message
msgId | Violation Message ID |
reportTarget | Report type (For example: involving pornography and terrorism) |
reportReason | Report Reason |
callBack | The result callback,see CallBack. |
void io.agora.chat.ChatManager.aysncRecallMessage | ( | final ChatMessage | message, |
final CallBack | callback | ||
) |
boolean io.agora.chat.ChatManager.deleteConversation | ( | String | username, |
boolean | deleteMessages | ||
) |
Deletes conversation and messages from the local database.
If you set deleteMessages
to true
, delete the local chat history when delete the conversation.
username | The conversation ID. |
deleteMessages | Whether to delete the chat history when delete the conversation.
|
True
means success;false
means failure. void io.agora.chat.ChatManager.deleteConversationFromServer | ( | String | username, |
ConversationType | type, | ||
boolean | isDeleteServerMessages, | ||
CallBack | deleteCallBack | ||
) |
Deletes the conversation of a specified ID and it's chat records on the server. This operation is performed asynchronously.
username | Conversation ID. |
type | conversation type ConversationType |
isDeleteServerMessages | Whether to delete the server chat records when delete conversation.
|
deleteCallBack | The callback to delete the server session and record successfully.
|
void io.agora.chat.ChatManager.deleteMessagesBeforeTimestamp | ( | long | timeStamp, |
CallBack | callback | ||
) |
Deletes the local message record before the timestamp.
timeStamp | The Unix timestamp, in milliseconds. |
callback | The result callback,see CallBack. |
void io.agora.chat.ChatManager.downloadAttachment | ( | final ChatMessage | msg | ) |
Downloads the message attachment.
You can call the method again if the attachment download fails.
msg | The message to be download the attachment. |
void io.agora.chat.ChatManager.downloadFile | ( | final String | remoteUrl, |
final String | localFilePath, | ||
final Map< String, String > | headers, | ||
final CallBack | callback | ||
) |
Downloads the attachment files from the server.
remoteUrl | The remote file url. |
localFilePath | The local file path. |
headers | The Http Request Headers. |
callback | The download status callback, see CallBack. |
void io.agora.chat.ChatManager.downloadThumbnail | ( | final ChatMessage | msg | ) |
Downloads the thumbnail if the msg is not downloaded before or the download failed.
msg | The message object. |
Map< String, Conversation > io.agora.chat.ChatManager.fetchConversationsFromServer | ( | ) | throws ChatException |
Fetches the conversation list from the server. The default maximum return is 100.
This is a synchronous method and blocks the current thread.
CursorResult< GroupReadAck > io.agora.chat.ChatManager.fetchGroupReadAcks | ( | String | msgId, |
int | pageSize, | ||
String | startAckId | ||
) | throws ChatException |
Fetches the receipt details for group messages from the server.
Fetches by page.
Reference: If you want to send group message read receipt, see ackConversationRead(String)
This is a synchronous method and blocks the current thread.
msgId | The message ID which needs to fetch receipt. |
pageSize | The number of records per page. |
startAckId | The start ID for fetching receipts, can be null. If you set it as null, the fetching will start from the server‘s latest receipt. |
ChatException | A description of the exception, see Error. |
CursorResult< ChatMessage > io.agora.chat.ChatManager.fetchHistoryMessages | ( | String | conversationId, |
ConversationType | type, | ||
int | pageSize, | ||
String | startMsgId | ||
) | throws ChatException |
Fetches history messages of the conversation from the server.
Fetches by page.
This is a synchronous method and blocks the current thread.
conversationId | The conversation ID. |
type | The conversation type which select to fetch roam message, see ConversationType |
pageSize | The number of records per page. |
startMsgId | The start search roam message, if the param is empty, fetches from the server latest message. |
ChatException | A description of the exception, see Error. |
CursorResult< ChatMessage > io.agora.chat.ChatManager.fetchHistoryMessages | ( | String | conversationId, |
ConversationType | type, | ||
int | pageSize, | ||
String | startMsgId, | ||
Conversation.SearchDirection | direction | ||
) | throws ChatException |
Fetches history messages of the conversation from the server.
Fetches by page.
This is a synchronous method and blocks the current thread.
conversationId | The conversation ID. |
type | The conversation type which select to fetch roam message, see ConversationType |
pageSize | The number of records per page. |
startMsgId | The start search roam message, if the param is empty, direction is io.agora.chat.Conversation.SearchDirection#UP , fetches from the server latest message, direction is io.agora.chat.Conversation.SearchDirection#DOWN , fetches from the server oldest message. |
direction | Roaming message retrieval direction, io.agora.chat.Conversation.SearchDirection#UP is the retrieval time stamp message less than the start message time stamp, io.agora.chat.Conversation.SearchDirection#DOWN is a message whose retrieval timestamp is greater than the timestamp of the start message. |
ChatException | A description of the exception, see Error. |
void io.agora.chat.ChatManager.fetchSupportLanguages | ( | ValueCallBack< List< Language > > | callBack | ) |
获取翻译服务支持的语言
callBack | 完成回调 |
Fetch all languages what the translate service support
callBack | Complete the callback |
Map< String, Conversation > io.agora.chat.ChatManager.getAllConversations | ( | ) |
Gets all conversations from the local database.
Conversations will be loaded from memory first, if no conversation is found then the SDk loads from the local database.
Conversation io.agora.chat.ChatManager.getConversation | ( | String | id | ) |
Gets the conversation object by the specified ID.
The SDK wil return null if the conversation is not found.
id | The conversation ID. |
Conversation io.agora.chat.ChatManager.getConversation | ( | String | id, |
ConversationType | type | ||
) |
Gets the conversation by conversation ID and conversation type.
The SDK wil return null if the conversation is not found.
id | The conversation ID. |
type | The conversation type, see ConversationType |
Conversation io.agora.chat.ChatManager.getConversation | ( | String | username, |
ConversationType | type, | ||
boolean | createIfNotExists | ||
) |
Get the conversation object by conversation ID and conversation type.
If the conversation is not found, you can create a new object based on the value of CreateIFNotExists or an empty object.
username | The conversation ID. |
type | The conversation type, see ConversationType. |
createIfNotExists | Whether to create a conversation if not find the specified conversation.
|
Conversation io.agora.chat.ChatManager.getConversation | ( | String | username, |
ConversationType | type, | ||
boolean | createIfNotExists, | ||
boolean | isChatThread | ||
) |
Get conversation object by conversation id and conversation type.
If the conversation is not found, you can create a new object based on the value of CreateIFNotExists or an empty object.
username | The conversation ID. |
type | The conversation type, see ConversationType. |
createIfNotExists | Whether to create a conversation if not find the specified conversation.
|
isChatThread | Whether to search chat thread conversation.
|
List< Conversation > io.agora.chat.ChatManager.getConversationsByType | ( | ConversationType | type | ) |
Gets the list of conversations by conversation type.
type | The conversation type, see ConversationType. |
ChatMessage io.agora.chat.ChatManager.getMessage | ( | String | messageId | ) |
Fetches messages by message ID.
messageId | The message ID. |
CursorResult< MessageReaction > io.agora.chat.ChatManager.getReactionDetail | ( | final String | messageId, |
final String | reaction, | ||
final String | cursor, | ||
final int | pageSize | ||
) | throws ChatException |
Gets the reaction details.
This is a synchronous method and blocks the current thread.
messageId | The message ID. |
reaction | The reaction content. |
cursor | The cursor position from which to get Reactions. |
pageSize | The number of Reactions you expect to get on each page. |
ChatException | A description of the exception, see Error. |
Map< String, List< MessageReaction > > io.agora.chat.ChatManager.getReactionList | ( | final List< String > | messageIdList, |
final ChatMessage.ChatType | chatType, | ||
final String | groupId | ||
) | throws ChatException |
Gets the list of Reactions.
This is a synchronous method and blocks the current thread.
messageIdList | The message ID. |
chatType | The chat type. Only one-to-one chat (ChatMessage.ChatType#Chat and group chat (ChatMessage.ChatType#GroupChat) are allowed. |
groupId | The group ID, which is invalid only when the chat type is group chat. |
ChatException | A description of the exception. See Error. |
int io.agora.chat.ChatManager.getUnreadMessageCount | ( | ) |
Gets the unread message count.
int io.agora.chat.ChatManager.getUnreadMsgsCount | ( | ) |
Gets the unread message count.
synchronized void io.agora.chat.ChatManager.importMessages | ( | List< ChatMessage > | msgs | ) |
Imports messages to the local database.
Make sure the message sender or receiver is the current user before option.
Recommends import less than 1,000 messages per operation.
msgs | The message list. |
void io.agora.chat.ChatManager.loadAllConversations | ( | ) |
Loads all conversations from the local database into memory. Generally used after a successful login to speed up the loading of the conversation list.
void io.agora.chat.ChatManager.markAllConversationsAsRead | ( | ) |
Marks all messages as read.
This method is for the local conversations only.
void io.agora.chat.ChatManager.recallMessage | ( | ChatMessage | message | ) | throws ChatException |
Recalls the sent message.
This is a synchronous method and blocks the current thread.
message | The message instance. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.ChatManager.removeConversationListener | ( | ConversationListener | listener | ) |
Removes the conversation listener.
Make sure to use the addConversationListener(ConversationListener) method first if you want to delete the conversation listener.
listener | The conversation listener to be removed. |
void io.agora.chat.ChatManager.removeMessageListener | ( | MessageListener | listener | ) |
Removes the message listener.
You should call this method after set addMessageListener(MessageListener) .
listener | The message listener to be removed. |
void io.agora.chat.ChatManager.removeReaction | ( | final String | messageId, |
final String | reaction | ||
) | throws ChatException |
Deletes a reaction.
This is a synchronous method and blocks the current thread.
messageId | The message ID. |
reaction | The message reaction. |
ChatException | A description of the exception. See Error. |
void io.agora.chat.ChatManager.reportMessage | ( | String | msgId, |
String | reportTarget, | ||
String | reportReason | ||
) | throws ChatException |
Report violation message
msgId | Violation Message ID |
reportTarget | Report type (For example: involving pornography and terrorism) |
reportReason | Report Reason |
ChatException | A description of the exception. See Error. |
void io.agora.chat.ChatManager.saveMessage | ( | ChatMessage | message | ) |
Saves the message to the memory and local database.
Notes: The CMD message will not be stored in the database.
message | The message to store. |
List< ChatMessage > io.agora.chat.ChatManager.searchMsgFromDB | ( | ChatMessage.Type | type, |
long | timeStamp, | ||
int | maxCount, | ||
String | from, | ||
Conversation.SearchDirection | direction | ||
) |
Searches messages from the local database according the parameters.
Note: Be cautious about the memory usage when the maxCount is large, currently the limited number is 400 entries at a time.
type | The message type, TXT、VOICE、IMAGE、VIDEO and so on, see ChatMessage.Type. |
timeStamp | The Unix timestamp when searching, in milliseconds. |
maxCount | The max number of message to search. |
from | A user ID or a group ID searches for messages, usually refers to the conversation ID. |
List< ChatMessage > io.agora.chat.ChatManager.searchMsgFromDB | ( | String | keywords, |
long | timeStamp, | ||
int | maxCount, | ||
String | from, | ||
Conversation.SearchDirection | direction | ||
) |
Searches messages from the database according to the parameters.
Note: Cautious about the memory usage when the maxCount is large, currently the limited number is 400 entries at a time.
keywords | The keywords in message. |
timeStamp | The timestamp for search, Unix timestamp, in milliseconds. |
maxCount | The max number of message to search at a time. |
from | A user ID or a group ID searches for messages, usually refers to the conversation ID. |
void io.agora.chat.ChatManager.sendMessage | ( | final ChatMessage | msg | ) |
Sends a message。
Reference: If the message is voice, picture and other message with attachment, the SDK will automatically upload the attachment. You can set whether to upload the attachment to the chat sever by ChatOptions#setAutoTransferMessageAttachments(boolean).
To listen for the status of sending messages, call ChatMessage#setMessageStatusCallback(CallBack).
msg | The message object to be sent. Make sure to set the param. |
void io.agora.chat.ChatManager.setMessageListened | ( | ChatMessage | message | ) |
Sets the message status as listened. Usually used for voice messages.
message | The message object. |
void io.agora.chat.ChatManager.setVoiceMessageListened | ( | ChatMessage | message | ) |
Sets the message status as listened. Usually used for voice messages.
message | The message object. |
void io.agora.chat.ChatManager.translateMessage | ( | ChatMessage | message, |
List< String > | languages, | ||
ValueCallBack< ChatMessage > | callBack | ||
) |
translate a message
message | The message object |
languages | List of target language codes to translate |
callBack | Complete the callback |
boolean io.agora.chat.ChatManager.updateMessage | ( | ChatMessage | message | ) |
Updates the local message.
Will update the memory and the local database at the same time.
message | The message objects to update. |
boolean io.agora.chat.ChatManager.updateParticipant | ( | String | from, |
String | changeTo | ||
) |
Updates the database records, changes username from 'from' to 'changeTo'. The method will effect on other counts, such as the message table, the conversation table, contacts, the blocklist table.
Note: this operation does not update the data stored in memory cache.
from | The user ID before replace. |
changeTo | The user ID after replace. |
false
.