Class Conversation
-
- All Implemented Interfaces:
public class Conversation
The entity of a conversation, used to contain and store the client's conversation information, corresponding to the conversation in the conversation list.
rongcloud
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
Conversation.PublicServiceType
Enumeration of public service types.
public enum
Conversation.ConversationType
Conversation type enumeration.
public enum
Conversation.ConversationNotificationStatus
Conversation reminder status.
-
Field Summary
Fields Modifier and Type Field Description public Conversation.ConversationType
conversationType
public String
targetId
public String
channelId
public String
conversationTitle
public String
portraitUrl
public int
unreadMessageCount
public boolean
isTop
public boolean
isTopForTag
public long
operationTime
public String
senderUserName
public String
draft
public Conversation.ConversationNotificationStatus
notificationStatus
public int
mentionedCount
public int
pushNotificationLevel
public IRongCoreEnum.UltraGroupChannelType
channelType
public long
firstUnreadMsgSendTime
public final static Creator<Conversation>
CREATOR
-
Constructor Summary
Constructors Constructor Description Conversation()
Default constructor. Conversation(Parcel in)
-
Method Summary
Modifier and Type Method Description Conversation.ConversationType
getConversationType()
Retrieves the conversation type. void
setConversationType(Conversation.ConversationType conversationType)
Sets the conversation type. String
getTargetId()
Retrieves the conversation ID. void
setTargetId(String targetId)
Sets the conversation ID. String
getChannelId()
The business identifier of the conversation to which the message belongs. void
setChannelId(String channelId)
Sets the business identifier of the conversation to which the message belongs. String
getConversationTitle()
Get the conversation title. void
setConversationTitle(String conversationTitle)
Sets the conversation title. String
getPortraitUrl()
Get the conversation avatar URL void
setPortraitUrl(String portraitUrl)
Sets the conversation avatar URL int
getUnreadMessageCount()
Get the count of unread messages. void
setUnreadMessageCount(int unreadMessageCount)
Sets the unread message count. boolean
isTop()
Retrieves the pinned status. void
setTop(boolean isTop)
Sets the pinned status. boolean
isTopForTag()
Retrieves the pinned status of the current conversation under this tag. void
setTopForTag(boolean isTopForTag)
Sets the pinned status of the current conversation under this tag. long
getOperationTime()
Gets the operation timestamp (Unix timestamp in milliseconds) for this conversation, used as the timestamp parameter when paginating through the conversation list. void
setOperationTime(long operationTime)
Sets the operation time for this conversation (Unix timestamp in milliseconds). String
getSenderUserName()
Retrieves the name of the user who sent the message. void
setSenderUserName(String senderUserName)
Sets the username of the message sender. String
getDraft()
Retrieves the draft present in the conversation. void
setDraft(String draft)
Sets the draft in the conversation. Conversation.ConversationNotificationStatus
getNotificationStatus()
Retrieves the message notification status. void
setNotificationStatus(Conversation.ConversationNotificationStatus notificationStatus)
Sets the status for retrieving notification messages. int
getMentionedCount()
Retrieves the count of unread messages in this conversation where you were mentioned. void
setMentionedCount(int count)
Sets the count of unread @ messages in this conversation. int
getPushNotificationLevel()
Get the Do Not Disturb notification level void
setPushNotificationLevel(int pushNotificationLevel)
Sets the Do Not Disturb notification level IRongCoreEnum.UltraGroupChannelType
getChannelType()
Retrieves the channel type of the ultra group conversation. void
setChannelType(IRongCoreEnum.UltraGroupChannelType channelType)
Sets the channel type for the ultra group conversation long
getFirstUnreadMsgSendTime()
Gets the timestamp of the first unread message in the conversation (Unix timestamp in milliseconds). void
setFirstUnreadMsgSendTime(long firstUnreadMsgSendTime)
Sets the timestamp of the first unread message in the conversation (Unix timestamp, in milliseconds). static Conversation
obtain(Conversation.ConversationType type, String id, String title)
Constructor. void
writeToParcel(Parcel dest, int flags)
int
describeContents()
ReceivedStatus
getReceivedStatus()
Retrieves the receipt status of the last message in the conversation. void
setReceivedStatus(ReceivedStatus receivedStatus)
Sets the received status of the last message in the conversation. SentStatus
getSentStatus()
Retrieves the send status of the last message in the conversation. void
setSentStatus(SentStatus sentStatus)
Sets the sending status of the last message in the conversation. long
getReceivedTime()
Retrieves the receive time of the last message in the conversation (Unix timestamp in milliseconds). void
setReceivedTime(long receivedTime)
Sets the received time of the last message in the conversation (Unix timestamp in milliseconds). long
getSentTime()
Get the sending time of the last message in the conversation (Unix timestamp, milliseconds) The sending time is the server time when the message arrives at the server from the sending client. void
setSentTime(long sentTime)
Sets the sent time of the last message in the conversation (Unix timestamp in milliseconds). String
getObjectName()
Gets the name of the message object. void
setObjectName(String objectName)
Sets the name of the message object. String
getSenderUserId()
Retrieves the user ID of the message sender. void
setSenderUserId(String senderUserId)
Sets the user ID of the message sender. int
getLatestMessageId()
Retrieves the ID of the last message in this conversation. void
setLatestMessageId(int latestMessageId)
Sets the ID of the last message in this conversation. MessageContent
getLatestMessage()
Retrieves the content of the last message in the conversation. void
setLatestMessage(MessageContent latestMessageContent)
Sets the content of the last message in the conversation. int
getUnreadMentionedCount()
Get the count of unread @ mentions in this conversation. int
getUnreadMentionedMeCount()
Retrieves the count of unread messages in this conversation where only you are mentioned. MessageDirection
getLatestMessageDirection()
Retrieves the message direction. void
setLatestMessageDirection(MessageDirection latestMessageDirection)
Sets the message direction. String
getLatestMessageExtra()
Retrieve the additional information of the message. void
setLatestMessageExtra(String latestMessageExtra)
Sets the additional information for the message. String
getLatestMessageUId()
Retrieves the unique message ID from the server (globally unique within the same AppKey). void
setLatestMessageUId(String latestMessageUId)
Sets the server message unique ID (globally unique within the same AppKey). ReadReceiptInfo
getLatestMessageReadReceiptInfo()
Retrieves the read receipt status of the last message. void
setLatestMessageReadReceiptInfo(ReadReceiptInfo latestMessageReadReceiptInfo)
Sets the read receipt status of the last message MessageConfig
getLatestMessageConfig()
Retrieves the message configuration. void
setLatestMessageConfig(MessageConfig latestMessageConfig)
Set message configuration boolean
isLatestCanIncludeExpansion()
Indicates whether the message can contain extended information. void
setLatestCanIncludeExpansion(boolean latestCanIncludeExpansion)
Sets whether the message can include extended information Map<String, String>
getLatestExpansion()
Retrieves the list of expansion information for the last message. void
setLatestExpansion(Map<String, String> latestExpansion)
Sets the latest message expansion information list. Message
getMessage()
Retrieves the latest message of the conversation void
setMessage(Message latestMessage)
The LatestMessage of the conversation void
setMentionedMeCount(int count)
Sets the count of unread @ messages in this conversation that are only for the current user. -
-
Method Detail
-
getConversationType
Conversation.ConversationType getConversationType()
Retrieves the conversation type.
- Returns:
The conversation type.
-
setConversationType
void setConversationType(Conversation.ConversationType conversationType)
Sets the conversation type.
- Parameters:
conversationType
- Specifies the conversation type.
-
getTargetId
String getTargetId()
Retrieves the conversation ID.
Depending on the conversationType, it could be a chat ID, discussion group ID, group ID, or chatroom ID.
- Returns:
The conversation ID.
-
setTargetId
void setTargetId(String targetId)
Sets the conversation ID.
Depending on the conversationType, this could be a chat ID, discussion group ID, group ID, or chatroom ID.
- Parameters:
targetId
- The conversation ID.
-
getChannelId
String getChannelId()
The business identifier of the conversation to which the message belongs.
- Returns:
The business identifier of the conversation to which the message belongs.
-
setChannelId
void setChannelId(String channelId)
Sets the business identifier of the conversation to which the message belongs. The maximum length is 20 characters.
- Parameters:
channelId
- The business identifier of the conversation to which the message belongs.
-
getConversationTitle
String getConversationTitle()
Get the conversation title.
- Returns:
The conversation title.
-
setConversationTitle
void setConversationTitle(String conversationTitle)
Sets the conversation title.
- Parameters:
conversationTitle
- The title of the conversation.
-
getPortraitUrl
String getPortraitUrl()
Get the conversation avatar URL
- Returns:
The conversation avatar URL
-
setPortraitUrl
void setPortraitUrl(String portraitUrl)
Sets the conversation avatar URL
- Parameters:
portraitUrl
- The URL of the conversation avatar
-
getUnreadMessageCount
int getUnreadMessageCount()
Get the count of unread messages.
- Returns:
The count of unread messages.
-
setUnreadMessageCount
void setUnreadMessageCount(int unreadMessageCount)
Sets the unread message count.
- Parameters:
unreadMessageCount
- The count of unread messages.
-
isTop
boolean isTop()
Retrieves the pinned status.
- Returns:
The pinned status.
-
setTop
void setTop(boolean isTop)
Sets the pinned status.
- Parameters:
isTop
- The pinned status.
-
isTopForTag
boolean isTopForTag()
Retrieves the pinned status of the current conversation under this tag.
This field is only valid when retrieving conversations by tag using {#getConversationsFromTagByPage}.
- Returns:
The pinned status.
- Since:
5.6.4
-
setTopForTag
void setTopForTag(boolean isTopForTag)
Sets the pinned status of the current conversation under this tag.
- Parameters:
isTopForTag
- The pinned status.- Since:
5.6.4
-
getOperationTime
long getOperationTime()
Gets the operation timestamp (Unix timestamp in milliseconds) for this conversation, used as the timestamp parameter when paginating through the conversation list.
The initial value is the same as sentTime. Operations such as pinning will update this timestamp.
- Returns:
The operation timestamp
- Since:
5.6.8
-
setOperationTime
void setOperationTime(long operationTime)
Sets the operation time for this conversation (Unix timestamp in milliseconds).
- Parameters:
operationTime
- The operation time- Since:
5.6.8
-
getSenderUserName
String getSenderUserName()
Retrieves the name of the user who sent the message.
- Returns:
The name of the user who sent the message.
-
setSenderUserName
void setSenderUserName(String senderUserName)
Sets the username of the message sender.
- Parameters:
senderUserName
- The username of the message sender.
-
getDraft
String getDraft()
Retrieves the draft present in the conversation.
- Returns:
The draft present in the conversation.
-
setDraft
void setDraft(String draft)
Sets the draft in the conversation.
- Parameters:
draft
- The draft in the conversation.
-
getNotificationStatus
Conversation.ConversationNotificationStatus getNotificationStatus()
Retrieves the message notification status.
- Returns:
The message notification status.
-
setNotificationStatus
void setNotificationStatus(Conversation.ConversationNotificationStatus notificationStatus)
Sets the status for retrieving notification messages.
- Parameters:
notificationStatus
- The status of the message.
-
getMentionedCount
@Deprecated() int getMentionedCount()
Retrieves the count of unread messages in this conversation where you were mentioned.
- Returns:
The count of unread mentions
-
setMentionedCount
void setMentionedCount(int count)
Sets the count of unread @ messages in this conversation.
- Parameters:
count
- The number of unread @ messages.
-
getPushNotificationLevel
int getPushNotificationLevel()
Get the Do Not Disturb notification level
- Returns:
The Do Not Disturb notification level
-
setPushNotificationLevel
void setPushNotificationLevel(int pushNotificationLevel)
Sets the Do Not Disturb notification level
- Parameters:
pushNotificationLevel
- The Do Not Disturb notification level
-
getChannelType
IRongCoreEnum.UltraGroupChannelType getChannelType()
Retrieves the channel type of the ultra group conversation.
- Returns:
The channel type.
- Since:
5.2.4
-
setChannelType
void setChannelType(IRongCoreEnum.UltraGroupChannelType channelType)
Sets the channel type for the ultra group conversation
- Parameters:
channelType
- The channel type- Since:
5.2.4
-
getFirstUnreadMsgSendTime
long getFirstUnreadMsgSendTime()
Gets the timestamp of the first unread message in the conversation (Unix timestamp in milliseconds).
- Returns:
The timestamp of the first unread message.
- Since:
5.2.5
-
setFirstUnreadMsgSendTime
void setFirstUnreadMsgSendTime(long firstUnreadMsgSendTime)
Sets the timestamp of the first unread message in the conversation (Unix timestamp, in milliseconds).
- Parameters:
firstUnreadMsgSendTime
- The timestamp of the first unread message- Since:
5.2.5
-
obtain
static Conversation obtain(Conversation.ConversationType type, String id, String title)
Constructor.
- Parameters:
type
- Specifies the conversation type.id
- Represents the conversation ID.title
- Indicates the conversation title.
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
describeContents
int describeContents()
-
getReceivedStatus
ReceivedStatus getReceivedStatus()
Retrieves the receipt status of the last message in the conversation.
- Returns:
The receipt status of the last message in the conversation.
-
setReceivedStatus
void setReceivedStatus(ReceivedStatus receivedStatus)
Sets the received status of the last message in the conversation.
- Parameters:
receivedStatus
- Indicates the received status of the last message in the conversation.
-
getSentStatus
SentStatus getSentStatus()
Retrieves the send status of the last message in the conversation.
- Returns:
The send status of the last message in the conversation.
-
setSentStatus
void setSentStatus(SentStatus sentStatus)
Sets the sending status of the last message in the conversation.
- Parameters:
sentStatus
- The sending status of the last message in the conversation.
-
getReceivedTime
long getReceivedTime()
Retrieves the receive time of the last message in the conversation (Unix timestamp in milliseconds).
The receive time is the local time of the client when the message arrives at the receiving client.
- Returns:
The receive time of the last message in the conversation (Unix timestamp in milliseconds).
-
setReceivedTime
void setReceivedTime(long receivedTime)
Sets the received time of the last message in the conversation (Unix timestamp in milliseconds).
- Parameters:
receivedTime
- The received time of the last message in the conversation (Unix timestamp in milliseconds).
-
getSentTime
long getSentTime()
Get the sending time of the last message in the conversation (Unix timestamp, milliseconds)
The sending time is the server time when the message arrives at the server from the sending client.
- Returns:
The sending time of the last message in the conversation (Unix timestamp, milliseconds)
-
setSentTime
void setSentTime(long sentTime)
Sets the sent time of the last message in the conversation (Unix timestamp in milliseconds).
The sent time is the server time when the message arrives at the server from the sending client.
- Parameters:
sentTime
- The sent time of the last message in the conversation (Unix timestamp in milliseconds)
-
getObjectName
String getObjectName()
Gets the name of the message object.
The name of the message object is the value specified in the annotation.
- Returns:
The name of the message object.
-
setObjectName
void setObjectName(String objectName)
Sets the name of the message object.
The name of the message object corresponds to the value in the annotation.
- Parameters:
objectName
- The name of the message object.
-
getSenderUserId
String getSenderUserId()
Retrieves the user ID of the message sender.
- Returns:
The user ID of the message sender.
-
setSenderUserId
void setSenderUserId(String senderUserId)
Sets the user ID of the message sender.
- Parameters:
senderUserId
- The user ID of the message sender.
-
getLatestMessageId
int getLatestMessageId()
Retrieves the ID of the last message in this conversation. (Unique database index value)
- Returns:
The ID of the last message in this conversation.
-
setLatestMessageId
void setLatestMessageId(int latestMessageId)
Sets the ID of the last message in this conversation. (Unique value for database indexing)
- Parameters:
latestMessageId
- The ID of the last message in this conversation.
-
getLatestMessage
MessageContent getLatestMessage()
Retrieves the content of the last message in the conversation.
- Returns:
The content of the last message in the conversation.
-
setLatestMessage
void setLatestMessage(MessageContent latestMessageContent)
Sets the content of the last message in the conversation.
- Parameters:
latestMessageContent
- The content of the last message in the conversation.
-
getUnreadMentionedCount
int getUnreadMentionedCount()
Get the count of unread @ mentions in this conversation.
/**
- Returns:
The number of unread @ mentions
-
getUnreadMentionedMeCount
int getUnreadMentionedMeCount()
Retrieves the count of unread messages in this conversation where only you are mentioned.
- Returns:
The number of unread mentions
-
getLatestMessageDirection
MessageDirection getLatestMessageDirection()
Retrieves the message direction.
- Returns:
The message direction.
-
setLatestMessageDirection
void setLatestMessageDirection(MessageDirection latestMessageDirection)
Sets the message direction.
- Parameters:
latestMessageDirection
- Specifies the message direction.
-
getLatestMessageExtra
String getLatestMessageExtra()
Retrieve the additional information of the message.
- Returns:
Specifies the additional information of the message.
-
setLatestMessageExtra
void setLatestMessageExtra(String latestMessageExtra)
Sets the additional information for the message.
- Parameters:
latestMessageExtra
- The additional information for the message.
-
getLatestMessageUId
String getLatestMessageUId()
Retrieves the unique message ID from the server (globally unique within the same AppKey).
- Returns:
uid The unique message ID from the server (globally unique within the same AppKey)
-
setLatestMessageUId
void setLatestMessageUId(String latestMessageUId)
Sets the server message unique ID (globally unique within the same AppKey).
- Parameters:
latestMessageUId
- The server message unique ID (globally unique within the same AppKey)
-
getLatestMessageReadReceiptInfo
ReadReceiptInfo getLatestMessageReadReceiptInfo()
Retrieves the read receipt status of the last message.
- Returns:
The read receipt status.
-
setLatestMessageReadReceiptInfo
void setLatestMessageReadReceiptInfo(ReadReceiptInfo latestMessageReadReceiptInfo)
Sets the read receipt status of the last message
- Parameters:
latestMessageReadReceiptInfo
- The read receipt status
-
getLatestMessageConfig
MessageConfig getLatestMessageConfig()
Retrieves the message configuration.
- Returns:
MessageConfig The message configuration.
-
setLatestMessageConfig
void setLatestMessageConfig(MessageConfig latestMessageConfig)
Set message configuration
- Parameters:
latestMessageConfig
- Message configuration
-
isLatestCanIncludeExpansion
boolean isLatestCanIncludeExpansion()
Indicates whether the message can contain extended information.
This property is determined when the message is sent and cannot be modified afterwards. Extended information is only supported in one-to-one chat and group chat. Other conversation types cannot set extended information.
- Returns:
Indicates whether the message can contain extended information.
-
setLatestCanIncludeExpansion
void setLatestCanIncludeExpansion(boolean latestCanIncludeExpansion)
Sets whether the message can include extended information
- Parameters:
latestCanIncludeExpansion
- Indicates whether the message can include extended information
-
getLatestExpansion
Map<String, String> getLatestExpansion()
Retrieves the list of expansion information for the last message.
- Returns:
List of message expansion information
-
setLatestExpansion
void setLatestExpansion(Map<String, String> latestExpansion)
Sets the latest message expansion information list.
- Parameters:
latestExpansion
- The list of message expansion information.
-
getMessage
Message getMessage()
Retrieves the latest message of the conversation
- Since:
5.8.0
-
setMessage
void setMessage(Message latestMessage)
The LatestMessage of the conversation
- Since:
5.8.0
-
setMentionedMeCount
void setMentionedMeCount(int count)
Sets the count of unread @ messages in this conversation that are only for the current user.
- Parameters:
count
- The count of unread messages.
-
-
-
-