Message

public final class Message

Message class.

message's envelope class, Contains message's general Property and Message content body content. Contains message's general Property and Message content body content.

  • general Field (ID, Sender, When time etc.) storage In Message

  • specific Message content (Text, Image etc.) storage In content, Type MessageContent Subclass

Usage Example:

val message: Message = ...
when (val content = message.content) {
is TextMessage -> println("Text: ${content.content}")
is ImageMessage -> println("Image: ${content.remoteUri}")
is FileMessage -> println("File: ${content.name}")
}

Parameters

channelIdentifier

Channel identifier, Contains Channel type and channel ID

content

Message content body, Type MessageContent or its Subclass

Constructors

Link copied to clipboard
public Message Message(ChannelIdentifier channelIdentifier, MessageContent content)

Properties

Link copied to clipboard
private final String channelId

belonging to channel ID (conversation target ID).

Link copied to clipboard

Channel identifier (Computed property).

Link copied to clipboard
private final ChannelType channelType

belonging to Channel type.

Link copied to clipboard
private final Integer clientId

Data database message table increment ID (Client Local ID).

Link copied to clipboard

Message content body

Link copied to clipboard
private List<String> directedUserIds

Targeted user ID List (Only group chat/community (ultra group) take effect, private chat Returns null)

Link copied to clipboard

Message direction (Send/Receive).

Link copied to clipboard
private Boolean disableUpdateLastMessage

Whether prohibit Update conversation the last messages.

Link copied to clipboard
private final Boolean hasChanged

message Whether Was/were has been modified (Only community (ultra group) message)

Link copied to clipboard
private final String messageId

Server unique message ID (In same AppKey under Global unique).

Link copied to clipboard
private final String messageType

Message type identifier (objectName), built-in Type see com.nexconn.chat.message.model.MessageType

Link copied to clipboard
private Map<String, String> metadata

Message expansion info List (key-value form, Supports Remote Sync).

Link copied to clipboard

Message edit info.

Link copied to clipboard
private Boolean needReceipt

message Whether need Read receipt.

Link copied to clipboard

Message receive status Info.

Link copied to clipboard
private String senderUserId

message Sender ID

Link copied to clipboard
private final Boolean sentReceipt

message Whether Already Send Read receipt.

Link copied to clipboard

Message send status.

Link copied to clipboard
private Long sentTime

message Send When time (Unix Timestamp, milli seconds), Server When time

Link copied to clipboard
private final String subChannelId

sub-channel ID (community (ultra group) Scenario under channel ID).

Functions

Link copied to clipboard
public final Unit cancelDownloadingMedia(ErrorHandler handler)

Cancel multiple Media message Download.

Link copied to clipboard
public final Unit deleteMetadata(List<String> keys, ErrorHandler handler)

Remove message's Extended info.

Link copied to clipboard
public final Unit download(String fileUniqueId, String fileUrl, String fileName, String path, DownloadMediaFileHandler handler)

Download file (Supports resumable Pass).

Link copied to clipboard

Download multiple Media message.

Link copied to clipboard
public final String getChannelId()

belonging to channel ID (conversation target ID).

Link copied to clipboard
Link copied to clipboard
public final ChannelType getChannelType()

belonging to Channel type.

Link copied to clipboard
public final Integer getClientId()

Data database message table increment ID (Client Local ID).

Link copied to clipboard
public final MessageContent getContent()

Message content body

Link copied to clipboard
public final List<String> getDirectedUserIds()

Targeted user ID List (Only group chat/community (ultra group) take effect, private chat Returns null)

Link copied to clipboard

Message direction (Send/Receive).

Link copied to clipboard
public final Boolean getDisableUpdateLastMessage()

Whether prohibit Update conversation the last messages.

Link copied to clipboard
public final Boolean getHasChanged()

message Whether Was/were has been modified (Only community (ultra group) message)

Link copied to clipboard
public final String getMessageId()

Server unique message ID (In same AppKey under Global unique).

Link copied to clipboard
public final String getMessageType()

Message type identifier (objectName), built-in Type see com.nexconn.chat.message.model.MessageType

Link copied to clipboard
public final Map<String, String> getMetadata()

Message expansion info List (key-value form, Supports Remote Sync).

Link copied to clipboard

Message edit info.

Link copied to clipboard
public final Boolean getNeedReceipt()

message Whether need Read receipt.

Link copied to clipboard

Message receive status Info.

Link copied to clipboard
public final String getSenderUserId()

message Sender ID

Link copied to clipboard
public final Boolean getSentReceipt()

message Whether Already Send Read receipt.

Link copied to clipboard

Message send status.

Link copied to clipboard
public final Long getSentTime()

message Send When time (Unix Timestamp, milli seconds), Server When time

Link copied to clipboard
public final String getSubChannelId()

sub-channel ID (community (ultra group) Scenario under channel ID).

Link copied to clipboard
public final Unit pauseDownloadFile(String fileUniqueId, ErrorHandler handler)

pause File Download (resumable Pass Scenario).

Link copied to clipboard
public final Unit pauseDownloadingMedia(ErrorHandler handler)

pause multi- Media message Download.

Link copied to clipboard
public final Unit requestSpeechToText(ErrorHandler handler)

request Voice message speech-to-text.

Link copied to clipboard
public final Unit setContent(MessageContent content)

Message content body

Link copied to clipboard
public final Unit setDirectedUserIds(List<String> directedUserIds)

Targeted user ID List (Only group chat/community (ultra group) take effect, private chat Returns null)

Link copied to clipboard
public final Unit setDirection(MessageDirection direction)

Message direction (Send/Receive).

Link copied to clipboard
public final Unit setDisableUpdateLastMessage(Boolean disableUpdateLastMessage)

Whether prohibit Update conversation the last messages.

Link copied to clipboard
public final Unit setMetadata(Map<String, String> metadata)

Message expansion info List (key-value form, Supports Remote Sync).

public final Unit setMetadata(Map<String, String> metadata, ErrorHandler handler)

Update message's Extended info.

Link copied to clipboard
public final Unit setModifyInfo(MessageModifyInfo modifyInfo)

Message edit info.

Link copied to clipboard
public final Unit setNeedReceipt(Boolean needReceipt)

message Whether need Read receipt.

Link copied to clipboard
public final Unit setReceivedStatusInfo(ReceivedStatus receivedStatusInfo)

Message receive status Info.

Link copied to clipboard
public final Unit setSenderUserId(String senderUserId)

message Sender ID

Link copied to clipboard
public final Unit setSentStatus(SendingStatus sentStatus)

Message send status.

Link copied to clipboard
public final Unit setSentTime(Long sentTime)

message Send When time (Unix Timestamp, milli seconds), Server When time

Link copied to clipboard
public final Unit setSpeechToTextVisible(Boolean visible, ErrorHandler handler)

Set Voice speech-to-text Result Visibility.

Link copied to clipboard
public String toString()