agora_chat_SDK 1.0.6
agora java chat SDK
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
io.agora.chat.ChatMessage Class Reference
Inheritance diagram for io.agora.chat.ChatMessage:

Classes

enum  ChatType
 
enum  Direct
 
class  EMCallbackHolder
 
enum  Status
 
enum  Type
 

Public Member Functions

Status status ()
 
 ChatMessage (EMAMessage message)
 
void setStatus (Status status)
 
Type getType ()
 
MessageBody getBody ()
 
long getMsgTime ()
 
void setMsgTime (long msgTime)
 
long localTime ()
 
void setLocalTime (long serverTime)
 
boolean isNeedGroupAck ()
 
void setIsNeedGroupAck (boolean need)
 
int groupAckCount ()
 
void setGroupAckCount (int count)
 
void setIsChatThreadMessage (boolean isChatThreadMessage)
 
boolean isChatThreadMessage ()
 
ChatThread getChatThread ()
 
void setBody (MessageBody body)
 
void addBody (MessageBody body)
 
String getFrom ()
 
void setFrom (String from)
 
String getRecaller ()
 
void setTo (String to)
 
String getTo ()
 
String getMsgId ()
 
void setMsgId (String msgId)
 
synchronized void setMessageStatusCallback (CallBack callback)
 
String toString ()
 
void setAttribute (String attribute, boolean value)
 
void setAttribute (String attribute, int value)
 
void setAttribute (String attribute, long value)
 
void setAttribute (String attribute, float value)
 
void setAttribute (String attribute, double value)
 
void setAttribute (String attribute, JSONObject value)
 
void setAttribute (String attribute, JSONArray value)
 
void setAttribute (String attribute, String value)
 
boolean getBooleanAttribute (String attribute) throws ChatException
 
boolean getBooleanAttribute (String attribute, boolean defaultValue)
 
int getIntAttribute (String attribute, int defaultValue)
 
long getLongAttribute (String attribute, long defaultValue)
 
float getFloatAttribute (String attribute, float defaultValue)
 
double getDoubleAttribute (String attribute, double defaultValue)
 
int getIntAttribute (String attribute) throws ChatException
 
long getLongAttribute (String attribute) throws ChatException
 
float getFloatAttribute (String attribute) throws ChatException
 
double getDoubleAttribute (String attribute) throws ChatException
 
String getStringAttribute (String attribute) throws ChatException
 
String getStringAttribute (String attribute, String defaultValue)
 
JSONObject getJSONObjectAttribute (String attribute) throws ChatException
 
JSONArray getJSONArrayAttribute (String attribute) throws ChatException
 
ChatType getChatType ()
 
void setChatType (ChatType chatType)
 
int describeContents ()
 
void writeToParcel (Parcel out, int flags)
 
Object clone () throws CloneNotSupportedException
 
boolean isAcked ()
 
void setAcked (boolean isAcked)
 
boolean isDelivered ()
 
void setDelivered (boolean isDelivered)
 
boolean isUnread ()
 
void setUnread (boolean unread)
 
boolean isListened ()
 
void setListened (boolean isListened)
 
String getUserName ()
 
void setDeliverAcked (boolean isDeliverAcked)
 
int progress ()
 
void setProgress (int progress)
 
Direct direct ()
 
void setDirection (Direct dir)
 
String conversationId ()
 
Map< String, Object > ext ()
 
List< MessageReactiongetMessageReaction ()
 
boolean isOnlineState ()
 

Static Public Member Functions

static ChatMessage createSendMessage (Type type)
 
static ChatMessage createReceiveMessage (Type type)
 
static ChatMessage createTxtSendMessage (String content, String username)
 
static ChatMessage createTextSendMessage (String content, String username)
 
static ChatMessage createVoiceSendMessage (String filePath, int timeLength, String username)
 
static ChatMessage createVoiceSendMessage (Uri filePath, int timeLength, String username)
 
static ChatMessage createImageSendMessage (String filePath, boolean sendOriginalImage, String username)
 
static ChatMessage createImageSendMessage (Uri imgUri, boolean sendOriginalImage, String username)
 
static ChatMessage createVideoSendMessage (String videofilePath, String imageThumbPath, int timeLength, String username)
 
static ChatMessage createVideoSendMessage (Uri videofilePath, String imageThumbPath, int timeLength, String username)
 
static ChatMessage createVideoSendMessage (Uri videofilePath, Uri imageThumbPath, int timeLength, String username)
 
static ChatMessage createLocationSendMessage (double latitude, double longitude, String locationAddress, String buildingName, String username)
 
static ChatMessage createLocationSendMessage (double latitude, double longitude, String locationAddress, String username)
 
static ChatMessage createFileSendMessage (String filePath, String username)
 
static ChatMessage createFileSendMessage (Uri filePath, String username)
 

Static Public Attributes

static final Parcelable.Creator< ChatMessageCREATOR
 

Detailed Description

The message instance, which represents a sent/received message.

For example: Constructs a text message to send:

ChatMessage msg = ChatMessage.createSendMessage(ChatMessage.Type.TXT);
msg.setTo("user1");
TextMessageBody body = new TextMessageBody("hello from hyphenate sdk");
msg.addBody(body);

Constructs a new received text message:

ChatMessage msg = ChatMessage.createSendMessage(ChatMessage.Type.IMAGE);
msg.setTo("user1");
ImageMessageBody body = new ImageMessageBody(imageFileUrl);
msg.addBody(body);

Member Function Documentation

◆ addBody()

void io.agora.chat.ChatMessage.addBody ( MessageBody  body)

Adds a message body. We recommend you use ChatMessage#setBody(io.agora.chat.MessageBody). Only support to add one now.

Parameters
bodyThe message body.

◆ conversationId()

String io.agora.chat.ChatMessage.conversationId ( )

Gets the conversation ID.

Returns
The conversation ID.

◆ createFileSendMessage() [1/2]

static ChatMessage io.agora.chat.ChatMessage.createFileSendMessage ( String  filePath,
String  username 
)
static

Creates a message to send a regular file.

Parameters
filePathThe file path.
usernameThe message recipient (user or group) ID.
Returns
The message instance.

◆ createFileSendMessage() [2/2]

static ChatMessage io.agora.chat.ChatMessage.createFileSendMessage ( Uri  filePath,
String  username 
)
static

Creates a message instance to send a regular file.

Parameters
filePathThe file path.
usernameThe message recipient (user or group) ID.
Returns
The message instance.

◆ createImageSendMessage() [1/2]

static ChatMessage io.agora.chat.ChatMessage.createImageSendMessage ( String  filePath,
boolean  sendOriginalImage,
String  username 
)
static

Creates an image message for sending.

Parameters
filePathThe image path.
sendOriginalImageWhether to send the original image.
  • (Default)false: For an image greater than 100 KB, the SDK will compress it.
  • true: Send the original image.
usernameThe message recipient (user or group) ID.
Returns
The message instance.

◆ createImageSendMessage() [2/2]

static ChatMessage io.agora.chat.ChatMessage.createImageSendMessage ( Uri  imgUri,
boolean  sendOriginalImage,
String  username 
)
static

Creates an image message for sending.

Parameters
imgUriThe URI of the image.
sendOriginalImageWhether to send the original.
  • (Default)false: For an image greater than 100 KB, the SDK will compress it.
  • true: Send the original image.
usernameThe recipient(user or group) ID.
Returns
The message instance.

◆ createLocationSendMessage() [1/2]

static ChatMessage io.agora.chat.ChatMessage.createLocationSendMessage ( double  latitude,
double  longitude,
String  locationAddress,
String  buildingName,
String  username 
)
static

Creates a location message for sending.

Parameters
latitudeThe latitude.
longitudeThe longitude.
locationAddressThe location details.
buildingNameThe name of the building.
usernameThe message recipient (user or group) ID.
Returns
The message instance.

◆ createLocationSendMessage() [2/2]

static ChatMessage io.agora.chat.ChatMessage.createLocationSendMessage ( double  latitude,
double  longitude,
String  locationAddress,
String  username 
)
static

Creates a location message for sending.

Parameters
latitudeThe latitude.
longitudeThe longitude.
locationAddressThe location details.
usernameThe message recipient (user or group) ID.
Returns
The message instance.

◆ createReceiveMessage()

static ChatMessage io.agora.chat.ChatMessage.createReceiveMessage ( Type  type)
static

Creates a new received message instance.

Parameters
typeThe message type.
Returns
The message instance.

◆ createSendMessage()

static ChatMessage io.agora.chat.ChatMessage.createSendMessage ( Type  type)
static

Creates a message instance for sending.

Parameters
typeThe message type.
Returns
The message instance.

◆ createTextSendMessage()

static ChatMessage io.agora.chat.ChatMessage.createTextSendMessage ( String  content,
String  username 
)
static

Creates a text message for sending.

Parameters
contentThe text content.
usernameThe ID of the message recipient(user or group).
Returns
The message instance.

◆ createTxtSendMessage()

static ChatMessage io.agora.chat.ChatMessage.createTxtSendMessage ( String  content,
String  username 
)
static

Creates a text message for sending.

Parameters
contentThe text content.
usernameThe ID of the message recipient(user or group).
Returns
The message instance.
Deprecated:
Use createTextSendMessage(String, String) to replace.

◆ createVideoSendMessage() [1/3]

static ChatMessage io.agora.chat.ChatMessage.createVideoSendMessage ( String  videofilePath,
String  imageThumbPath,
int  timeLength,
String  username 
)
static

Creates a video message instance for sending.

Parameters
videofilePathThe path of the video file.
imageThumbPathThe path of the thumbnail.
timeLengthThe video duration in seconds.
usernameThe message recipient(user or group) ID.
Returns
The message instance.

◆ createVideoSendMessage() [2/3]

static ChatMessage io.agora.chat.ChatMessage.createVideoSendMessage ( Uri  videofilePath,
String  imageThumbPath,
int  timeLength,
String  username 
)
static

Creates a video message instance for sending.

Parameters
videofilePathThe path of the video file.
imageThumbPathThe path of the thumbnail of the first frame of video.
timeLengthThe video duration in seconds.
usernameThe message recipient(user or group) ID.
Returns
The message instance.

◆ createVideoSendMessage() [3/3]

static ChatMessage io.agora.chat.ChatMessage.createVideoSendMessage ( Uri  videofilePath,
Uri  imageThumbPath,
int  timeLength,
String  username 
)
static

Creates a video message instance for sending.

Parameters
videofilePathThe path of the video file.
imageThumbPathThe path of the thumbnail of the first frame of video.
timeLengthThe video duration in seconds.
usernameThe message recipient(user or group) ID.
Returns
The message instance.

◆ createVoiceSendMessage() [1/2]

static ChatMessage io.agora.chat.ChatMessage.createVoiceSendMessage ( String  filePath,
int  timeLength,
String  username 
)
static

Creates a voice message for sending.

Parameters
filePathThe path of the voice file.
timeLengthThe voice duration in seconds.
usernameThe message recipient (user or group) ID.
Returns
The message instance.

◆ createVoiceSendMessage() [2/2]

static ChatMessage io.agora.chat.ChatMessage.createVoiceSendMessage ( Uri  filePath,
int  timeLength,
String  username 
)
static

Creates a voice message for sending.

Parameters
filePathThe URI of the voice file.
timeLengthThe voice duration in seconds.
usernameThe message recipient (user or group) ID.
Returns
The message instance.

◆ direct()

Direct io.agora.chat.ChatMessage.direct ( )

The message direction.

Returns
SEND or RECEIVE, see Direct.

◆ ext()

Map< String, Object > io.agora.chat.ChatMessage.ext ( )

Gets all of the message‘s extension. The return type is Map<String, Object>.

Returns
Returns the message's extension. The return type is Map<String, Object>. The object can be Boolean, Integer, Long, Float, Double, String. If the input is JsonObject or JsonArray, which use setAttribute(String attribute, JSONObject json) to passed in, the Map.Entry.value type is String.

◆ getBody()

MessageBody io.agora.chat.ChatMessage.getBody ( )

Gets the message body.

Returns
The message body.

◆ getBooleanAttribute() [1/2]

boolean io.agora.chat.ChatMessage.getBooleanAttribute ( String  attribute) throws ChatException

Gets a message extension attribute of the boolean type.

Parameters
attributeThe attribute name.
Returns
The attribute value.
Exceptions
ChatExceptionWhen exceptions occur, you can troubleshoot issues by referring to the error code and the error description.

◆ getBooleanAttribute() [2/2]

boolean io.agora.chat.ChatMessage.getBooleanAttribute ( String  attribute,
boolean  defaultValue 
)

Gets a message extension attribute of the boolean type.

Parameters
attributeThe attribute name.
defaultValueThe default value you want.
Returns
The attribute value.

◆ getChatType()

ChatType io.agora.chat.ChatMessage.getChatType ( )

Gets the chat type.

Returns
The chat type.

◆ getDoubleAttribute() [1/2]

double io.agora.chat.ChatMessage.getDoubleAttribute ( String  attribute) throws ChatException

Gets a message extension attribute of the double type.

Parameters
attributeThe attribute name.
Returns
The attribute value.
Exceptions
ChatExceptionWhen exceptions occur, you can troubleshoot issues by referring to the error code and the error description.

◆ getDoubleAttribute() [2/2]

double io.agora.chat.ChatMessage.getDoubleAttribute ( String  attribute,
double  defaultValue 
)

Gets a message extension attribute of the double type.

Parameters
attributeThe attribute name.
defaultValueThe default value you want.
Returns
The attribute value.

◆ getFloatAttribute() [1/2]

float io.agora.chat.ChatMessage.getFloatAttribute ( String  attribute) throws ChatException

Gets a message extension attribute of the float type.

Parameters
attributeThe attribute name.
Returns
The attribute value.
Exceptions
ChatExceptionWhen exceptions occur, you can troubleshoot issues by referring to the error code and the error description.

◆ getFloatAttribute() [2/2]

float io.agora.chat.ChatMessage.getFloatAttribute ( String  attribute,
float  defaultValue 
)

Gets a message extension attribute of the float type.

Parameters
attributeThe attribute name.
defaultValueThe default value you want.
Returns
The attribute value.

◆ getFrom()

String io.agora.chat.ChatMessage.getFrom ( )

Gets the user ID of the message sender.

Returns
The user ID.

◆ getIntAttribute() [1/2]

int io.agora.chat.ChatMessage.getIntAttribute ( String  attribute) throws ChatException

Gets an extension attribute of the integer type.

Parameters
attributeThe attribute name.
Returns
The attribute value.
Exceptions
ChatExceptionWhen exceptions occur, you can troubleshoot issues by referring to the error code and the error description.

◆ getIntAttribute() [2/2]

int io.agora.chat.ChatMessage.getIntAttribute ( String  attribute,
int  defaultValue 
)

Gets a message extension attribute of the integer type.

Parameters
attributeThe attribute name.
defaultValueThe default value you want.
Returns
The attribute value.

◆ getJSONArrayAttribute()

JSONArray io.agora.chat.ChatMessage.getJSONArrayAttribute ( String  attribute) throws ChatException

Gets a JSONArray type attribute.

Parameters
attributeThe attribute name.
Returns
The attribute value.
Exceptions
ChatExceptionWhen exceptions occur, you can troubleshoot issues by referring to the error code and the error description.

◆ getJSONObjectAttribute()

JSONObject io.agora.chat.ChatMessage.getJSONObjectAttribute ( String  attribute) throws ChatException

Gets the JSONObject type attribute.

Parameters
attributeThe attribute name.
Returns
The attribute value.
Exceptions
ChatExceptionWhen exceptions occur, you can troubleshoot issues by referring to the error code and the error description.

◆ getLongAttribute() [1/2]

long io.agora.chat.ChatMessage.getLongAttribute ( String  attribute) throws ChatException

Gets a message extension attribute of the long integer type.

Parameters
attributeThe attribute name.
Returns
The attribute value.
Exceptions
ChatExceptionWhen exceptions occur, you can troubleshoot issues by referring to the error code and the error description.

◆ getLongAttribute() [2/2]

long io.agora.chat.ChatMessage.getLongAttribute ( String  attribute,
long  defaultValue 
)

Gets a message extension attribute of the long integer type.

Parameters
attributeThe attribute name.
defaultValueThe default value you want.
Returns
The attribute value.

◆ getMessageReaction()

List< MessageReaction > io.agora.chat.ChatMessage.getMessageReaction ( )

Gets the list of Reactions.

Returns
The list of Reactions.

◆ getMsgId()

String io.agora.chat.ChatMessage.getMsgId ( )

Gets the message ID.

Returns
The message ID.

◆ getMsgTime()

long io.agora.chat.ChatMessage.getMsgTime ( )

Gets the Unix timestamp (server time) of the message.

Returns
The Unix timestamp (server time) of the message.

◆ getRecaller()

String io.agora.chat.ChatMessage.getRecaller ( )

Gets the ID of the user that recalls the message.

Returns
The ID of the user that recalls the message.

◆ getStringAttribute() [1/2]

String io.agora.chat.ChatMessage.getStringAttribute ( String  attribute) throws ChatException

Gets a string type extension attribute

Parameters
attributeThe attribute name.
Returns
The attribute value.
Exceptions
ChatExceptionThe error code and the description of the cause of exception.

◆ getStringAttribute() [2/2]

String io.agora.chat.ChatMessage.getStringAttribute ( String  attribute,
String  defaultValue 
)

Gets a string type extension attribute

Parameters
attributeThe attribute name.
defaultValueThe default value you want.
Returns
The attribute value.

◆ getTo()

String io.agora.chat.ChatMessage.getTo ( )

Gets the user ID of the message recipient.

Returns
The user ID of the message recipient.

◆ getType()

Type io.agora.chat.ChatMessage.getType ( )

\chinese 获取消息类型。

Returns
消息类型。

Gets the chat message type.

Returns
The chat message type.

◆ getUserName()

String io.agora.chat.ChatMessage.getUserName ( )

Gets the other party's ID.

Returns
The other party's user ID.

◆ groupAckCount()

int io.agora.chat.ChatMessage.groupAckCount ( )

Gets the number of members that have read the group message.

Returns
The number of members that have read the group message.

◆ isAcked()

boolean io.agora.chat.ChatMessage.isAcked ( )

Gets whether the other party has read the message.

Returns
Whether the other party has read the message. true: the other party has read the message.

◆ isDelivered()

boolean io.agora.chat.ChatMessage.isDelivered ( )

Gets the delivery receipt, which is to check whether the other party has received the message.

Returns
Whether the other party has received the message. true:the message has been delivered to the other party.

◆ isListened()

boolean io.agora.chat.ChatMessage.isListened ( )

Gets whether the voice message has been listened.

Returns
- true: The voice message has been listened.
  • false: The voice message has NOT been listened.

◆ isNeedGroupAck()

boolean io.agora.chat.ChatMessage.isNeedGroupAck ( )

Sets whether read receipts are required for group messages.

Returns
- true: Read receipts are required;
  • false: Read receipts are NOT required.

◆ isOnlineState()

boolean io.agora.chat.ChatMessage.isOnlineState ( )

Is it an online message.

Returns
Whether is online.

◆ isUnread()

boolean io.agora.chat.ChatMessage.isUnread ( )

Checks whether the message is unread.

Returns
Whether the message is unread. -true: The message is unread. -false: The message is read.

◆ localTime()

long io.agora.chat.ChatMessage.localTime ( )

Gets the local timestamp of the message.

Returns
The local timestamp of the message.

◆ progress()

int io.agora.chat.ChatMessage.progress ( )

The upload or download progress value of the message attachment in the message body. The value ranges between 0-100. For the thumbnail of the message attachment, it doesn't has progress information.

Returns
The progress value.

◆ setAcked()

void io.agora.chat.ChatMessage.setAcked ( boolean  isAcked)

Sets whether the message has been read by the other party. The method is supposed to be called by the SDK instead of you.

Parameters
isAcked- true:the message has been read by the other party.

◆ setAttribute() [1/8]

void io.agora.chat.ChatMessage.setAttribute ( String  attribute,
boolean  value 
)

Sets a message's extension attribute of the boolean type.

Parameters
attributeThe attribute name.
valueThe attribute value.

◆ setAttribute() [2/8]

void io.agora.chat.ChatMessage.setAttribute ( String  attribute,
double  value 
)

Sets a message extension attribute of the double type.

Parameters
attributeThe attribute name.
valueThe attribute value.

◆ setAttribute() [3/8]

void io.agora.chat.ChatMessage.setAttribute ( String  attribute,
float  value 
)

Sets a message extension attribute of the float type.

Parameters
attributeThe attribute name.
valueThe attribute value.

◆ setAttribute() [4/8]

void io.agora.chat.ChatMessage.setAttribute ( String  attribute,
int  value 
)

Sets a message extension attribute of the integer type.

Parameters
attributeThe attribute name.
valueThe attribute value.

◆ setAttribute() [5/8]

void io.agora.chat.ChatMessage.setAttribute ( String  attribute,
JSONArray  value 
)

Sets a message extension attribute of the JSONArray type.

Parameters
attributeThe attribute name.
valueThe attribute value.

◆ setAttribute() [6/8]

void io.agora.chat.ChatMessage.setAttribute ( String  attribute,
JSONObject  value 
)

Sets a message extension attribute of the JsonObject type.

Parameters
attributeThe attribute name.
valueThe attribute value.

◆ setAttribute() [7/8]

void io.agora.chat.ChatMessage.setAttribute ( String  attribute,
long  value 
)

Sets a message extension attribute of the long type.

Parameters
attributeThe attribute name.
valueThe attribute value.

◆ setAttribute() [8/8]

void io.agora.chat.ChatMessage.setAttribute ( String  attribute,
String  value 
)

Sets a string type extension attributes of the message.

Parameters
attributeThe attribute name.
valueThe attribute value.

◆ setBody()

void io.agora.chat.ChatMessage.setBody ( MessageBody  body)

(Recommended)Sets the message body.

Parameters
bodyThe message body.

◆ setChatType()

void io.agora.chat.ChatMessage.setChatType ( ChatType  chatType)

Sets the chat type. The default value is one-to-one chat(single chat) ChatType#Chat.

Parameters
chatTypeThe chat type, see ChatType.

◆ setDeliverAcked()

void io.agora.chat.ChatMessage.setDeliverAcked ( boolean  isDeliverAcked)

Sets the message deliver ack. The method is supposed to be called by the SDK instead of you.

Parameters
isDeliverAcked- true: The message is delivered to the other party.
  • false: The message has not been delivered to the other party.

◆ setDelivered()

void io.agora.chat.ChatMessage.setDelivered ( boolean  isDelivered)

Sets whether the message has been delivered to the other party. The method is supposed to be called by the SDK instead of you.

Parameters
isDelivered- true: The message has been delivered to the other party.

◆ setDirection()

void io.agora.chat.ChatMessage.setDirection ( Direct  dir)

Sets the message direction.

Parameters
dirThe message direction, see Direct.

◆ setFrom()

void io.agora.chat.ChatMessage.setFrom ( String  from)

Sets the user ID of the message sender.

Parameters
fromThe user ID of the message sender.

◆ setGroupAckCount()

void io.agora.chat.ChatMessage.setGroupAckCount ( int  count)

Sets the number of members that have read the group message.

Parameters
countThe number of members that have read the group message.

◆ setIsNeedGroupAck()

void io.agora.chat.ChatMessage.setIsNeedGroupAck ( boolean  need)

Sets whether read receipts are required for group messages.

Parameters
need- true: Read receipts are required;
  • false: Read receipts are NOT required.

◆ setListened()

void io.agora.chat.ChatMessage.setListened ( boolean  isListened)

Sets whether the voice message has been listened.

The method is supposed to be called by the SDK instead of you.

Parameters
isListened- true: Sets the voice message as listened.
  • false: Sets the voice message as NOT listened.

◆ setLocalTime()

void io.agora.chat.ChatMessage.setLocalTime ( long  serverTime)

Sets the local timestamp of the message.

Parameters
serverTimeThe local timestamp of the message.

◆ setMessageStatusCallback()

synchronized void io.agora.chat.ChatMessage.setMessageStatusCallback ( CallBack  callback)

Sets the message status change callback. Your app should set emaObject callback to get the message status and then refresh the UI accordingly.

Parameters
callbackThe callback when the message status changed.

◆ setMsgId()

void io.agora.chat.ChatMessage.setMsgId ( String  msgId)

Sets the local message ID.

Parameters
msgIdSets the local message ID.

◆ setMsgTime()

void io.agora.chat.ChatMessage.setMsgTime ( long  msgTime)

Sets the Unix timestamp (server time) of the message.

Parameters
msgTimeThe Unix timestamp (server time) of the message.

◆ setProgress()

void io.agora.chat.ChatMessage.setProgress ( int  progress)

Sets the upload or download progress value of the message attachment. The value ranges between 0-100. Usually you don't need to set progress value.

Parameters
progress

◆ setStatus()

void io.agora.chat.ChatMessage.setStatus ( Status  status)

Sets the message sending or reception status.

Parameters
statusThe message sending or reception status.

◆ setTo()

void io.agora.chat.ChatMessage.setTo ( String  to)

Sets the user ID of the message recipient.

Parameters
toThe user ID of the message recipient.

◆ setUnread()

void io.agora.chat.ChatMessage.setUnread ( boolean  unread)

Sets the message as unread.

  • true: Sets the message as unread.
  • false: Sets the message as read.

Reference: We recommend you to use Conversation#markAllMessagesAsRead() in a conversation.

Parameters
unread
  • true: Sets the message as unread.
  • false: Sets the message as read.

◆ status()

Status io.agora.chat.ChatMessage.status ( )

Gets the message sending/reception status.

Returns
The message sending/reception status.

Member Data Documentation

◆ CREATOR

final Parcelable.Creator<ChatMessage> io.agora.chat.ChatMessage.CREATOR
static
Initial value:
= new Parcelable.Creator<ChatMessage>() {
public ChatMessage createFromParcel(Parcel in) {
ChatMessage msg = null;
try {
msg = new ChatMessage(in);
} catch (ChatException e) {
e.printStackTrace();
}
return msg;
}
public ChatMessage[] newArray(int size) {
return new ChatMessage[size];
}
}

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