Message

public class Message

The message object that contains and stores the message information received by the client, corresponding to the message in the chat UI.

Author

rongcloud

Constructors

Link copied to clipboard
public void Message()
Default constructor.
public void Message(Parcel in)

Types

Link copied to clipboard
public enum MessageDirection
Message Direction Enumeration.
Link copied to clipboard
public class ReceivedStatus
The status of the received message.
Link copied to clipboard
public enum SentStatus
The status of the sent message.

Properties

Link copied to clipboard
public String channelId
Link copied to clipboard
public MessageContent content
Link copied to clipboard
public ConversationType conversationType
Link copied to clipboard
public final static Creator<Message> CREATOR
Link copied to clipboard
public List<String> directedUserIds
Link copied to clipboard
public Map<String, String> expansion
Link copied to clipboard
public String extra
Link copied to clipboard
public boolean isEmptyContent
Indicates whether the content of this message is empty.
Link copied to clipboard
public boolean isOffline
Link copied to clipboard
public MessageConfig messageConfig
Link copied to clipboard
Link copied to clipboard
public int messageId
Link copied to clipboard
public MessagePushConfig messagePushConfig
Link copied to clipboard
public String objectName
Link copied to clipboard
public ReadReceiptInfo readReceiptInfo
Link copied to clipboard
public ReadReceiptInfoV4 readReceiptInfoV4
Shared by v2 and v4
Link copied to clipboard
public long readTime
Link copied to clipboard
Link copied to clipboard
public long receivedTime
Link copied to clipboard
public String senderUserId
Link copied to clipboard
Link copied to clipboard
public long sentTime
Link copied to clipboard
public String targetId

Functions

Link copied to clipboard
public int describeContents()
Link copied to clipboard
public boolean equals(Object o)
Link copied to clipboard
public String getChannelId()
Get Channel ID
Link copied to clipboard
public MessageContent getContent()
Retrieves the message content.
Link copied to clipboard
public ConversationType getConversationType()
Retrieves the conversation type.
Link copied to clipboard
public List<String> getDirectedUserIds()
Get the list of targeted users Returns empty for one-to-one chat conversation type
Link copied to clipboard
public Map<String, String> getExpansion()
List of message extension information
Link copied to clipboard
public String getExtra()
Retrieves the additional information of the message.
Link copied to clipboard
public GroupReadReceiptInfoV2 getGroupReadReceiptInfoV2()
Get Read Receipt V2 Information
Link copied to clipboard
public MessageConfig getMessageConfig()
Get Message Configuration
Link copied to clipboard
Retrieves the message direction.
Link copied to clipboard
public int getMessageId()
Retrieves the unique value (database index unique value) of the locally stored message.
Link copied to clipboard
public MessagePushConfig getMessagePushConfig()
Get Push Notification Configuration
Link copied to clipboard
public String getObjectName()
Gets the name of the message object.
Link copied to clipboard
public ReadReceiptInfo getReadReceiptInfo()
Get the read receipt status
Link copied to clipboard
public ReadReceiptInfoV4 getReadReceiptInfoV4()
Retrieves the Read Receipt V4 information.
Link copied to clipboard
public long getReadTime()
Link copied to clipboard
Retrieves the receipt status of the message.
Link copied to clipboard
public long getReceivedTime()
Gets the message received time (Unix timestamp in milliseconds).
Link copied to clipboard
public String getSenderUserId()
Retrieves the user ID of the message sender.
Link copied to clipboard
Retrieves the sending status of the message.
Link copied to clipboard
public long getSentTime()
Get the message sending time (Unix timestamp, in milliseconds).
Link copied to clipboard
public String getTargetId()
Retrieves the target ID.
Link copied to clipboard
public String getUId()
Get the unique ID of the server message (globally unique under the same AppKey).
Link copied to clipboard
public int hashCode()
Link copied to clipboard
public boolean isCanIncludeExpansion()
Indicates whether the message can include extended information.
Link copied to clipboard
public boolean isDisableUpdateLastMessage()
Link copied to clipboard
public boolean isEmptyContent()
Link copied to clipboard
public boolean isHasChanged()
Indicates whether the message has been modified.
Link copied to clipboard
public boolean isMayHasMoreMessagesBefore()
Link copied to clipboard
public boolean isOffline()
Indicates whether the message is an offline message.
Link copied to clipboard
public static Message obtain(ConversationIdentifier conversationIdentifier, MessageContent content)
public static Message obtain(String targetId, ConversationType type, MessageContent content)
public static Message obtain(String targetId, ConversationType type, String channelId, MessageContent content)
Constructor.
Link copied to clipboard
public void setCanIncludeExpansion(boolean canIncludeExpansion)
Sets whether to include extended information.
Link copied to clipboard
public void setChannelId(String channelId)
Sets the channel ID with a maximum length of 20 characters.
Link copied to clipboard
public void setContent(MessageContent content)
Sets the message content.
Link copied to clipboard
public void setConversationType(ConversationType conversationType)
Sets the conversation type.
Link copied to clipboard
public void setDirectedUserIds(List<String> directedUserIds)
Set the list of targeted users
Link copied to clipboard
public void setDisableUpdateLastMessage(boolean disableUpdateLastMessage)
Link copied to clipboard
public void setExpansion(HashMap<String, String> expansion)
Set the message extension information list Extension information is only supported for one-to-one chat and group chat.
Link copied to clipboard
public void setExtra(String extra)
Sets the extra information of the message.
Link copied to clipboard
public void setGroupReadReceiptInfoV2(GroupReadReceiptInfoV2 v2)
Sets the read receipt V2 information.
Link copied to clipboard
public void setHasChanged(boolean hasChanged)
Sets whether the message has been modified.
Link copied to clipboard
public void setMessageConfig(MessageConfig messageConfig)
Set message configuration
Link copied to clipboard
public void setMessageDirection(Message.MessageDirection messageDirection)
Sets the message direction.
Link copied to clipboard
public void setMessageId(int messageId)
Sets the unique value for the locally stored message (database index unique value).
Link copied to clipboard
public void setMessagePushConfig(MessagePushConfig messagePushConfig)
Set push notification configuration
Link copied to clipboard
public void setObjectName(String objectName)
Sets the name of the message object.
Link copied to clipboard
public void setOffline(boolean offLine)
Sets whether the message is an offline message.
Link copied to clipboard
public void setReadReceiptInfo(ReadReceiptInfo readReceiptInfo)
Sets the read receipt status
Link copied to clipboard
public void setReadReceiptInfoV4(ReadReceiptInfoV4 readReceiptInfo)
Sets the read receipt V4 information
Link copied to clipboard
public void setReadTime(long readTime)
Link copied to clipboard
public void setReceivedStatus(Message.ReceivedStatus receivedStatus)
Sets the received status of the message.
Link copied to clipboard
public void setReceivedTime(long receivedTime)
Sets the message received time (Unix timestamp in milliseconds).
Link copied to clipboard
public void setSenderUserId(String senderUserId)
Sets the user ID of the message sender.
Link copied to clipboard
public void setSentStatus(Message.SentStatus sentStatus)
Sets the sending status of the message.
Link copied to clipboard
public void setSentTime(long sentTime)
Sets the message sending time (Unix timestamp in milliseconds).
Link copied to clipboard
public void setTargetId(String targetId)
Sets the target ID.
Link copied to clipboard
public void setUId(String UId)
Sets the unique ID for the server message (globally unique within the same AppKey).
Link copied to clipboard
public String toString()
Link copied to clipboard
public void writeToParcel(Parcel dest, int flags)