MessageContent

public abstract class MessageContent

The base class for messages.

Defines methods for converting between message objects and message data.

Constructors

Link copied to clipboard
public void MessageContent(Array<byte> data)
Deserializes message data into a local message object.

Properties

Link copied to clipboard
public MessageAuditInfo auditInfo
Message Review Configuration
Link copied to clipboard
public long destructTime
Specifies the auto-destruct timer.
Link copied to clipboard
public boolean isDestruct
Indicates whether it is a timed self-destruct message
Link copied to clipboard
public MentionedInfo mentionedInfo
Message contains @mention information
Link copied to clipboard
public Array<byte> rawJsonData
The raw JSON binary content of the message.
Link copied to clipboard
public UserInfo userInfo
User Information

Functions

Link copied to clipboard
public abstract Array<byte> encode()
Serializes the local message object into message data.
Link copied to clipboard
public MessageAuditInfo getAuditInfo()
Retrieves the message moderation configuration
Link copied to clipboard
public JSONObject getBaseJsonObject()
Converts the self-destruct field, @ mention field, user info field, and extra field of the base class into a JSONObject.
Link copied to clipboard
public long getDestructTime()
Retrieves the auto-destroy time.
Link copied to clipboard
public String getExtra()
Get message extension information
Link copied to clipboard
public JSONObject getJSONDestructInfo()
Link copied to clipboard
public JSONObject getJSONUserInfo()
Link copied to clipboard
public MentionedInfo getMentionedInfo()
Get @user information
Link copied to clipboard
public Array<byte> getRawJsonData()
Retrieves the raw binary data of the message.
Link copied to clipboard
public List<String> getSearchableWord()
Returns the searchable content within the message body.
Link copied to clipboard
public UserInfo getUserInfo()
Get user information
Link copied to clipboard
public boolean isDestruct()
Indicates whether the message is set to auto-destroy after a certain time.
Link copied to clipboard
public void parseBaseJsonObject(JSONObject jsonObject)
Parses the self-destruct field, @ mention field, user information field, and extra field from the JSONObject into the message body.
Link copied to clipboard
public void parseJsonToDestructInfo(JSONObject jsonObject)
Link copied to clipboard
public UserInfo parseJsonToUserInfo(JSONObject jsonObj)
Parses the user JSON object
Link copied to clipboard
public void readFromBaseInfoParcel(Parcel in)
Link copied to clipboard
public void setAuditInfo(MessageAuditInfo auditInfo)
Set message moderation configuration
Link copied to clipboard
public void setDestruct(boolean destruct)
Sets whether the message is timed-destruct.
Link copied to clipboard
public void setDestructTime(long destructTime)
Sets the self-destruct timer.
Link copied to clipboard
public void setExtra(String extra)
Sets the message extended information
Link copied to clipboard
public void setMentionedInfo(MentionedInfo info)
Set @ user information
Link copied to clipboard
public void setRawJsonData(Array<byte> rawJsonData)
Sets the raw binary data of the message.
Link copied to clipboard
public void setUserInfo(UserInfo info)
Set user information
Link copied to clipboard
public void writeToBaseInfoParcel(Parcel dest)
Writes the data of the base class's self-destruct field, @ mention field, user information field, and extra field into the externally provided Parcel.