Class Conversation
-
- All Implemented Interfaces:
public class ConversationThe 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 enumConversation.PublicServiceTypeEnumeration of public service types.
public enumConversation.ConversationTypeConversation type enumeration.
public enumConversation.ConversationNotificationStatusConversation reminder status.
-
Field Summary
Fields Modifier and Type Field Description public Conversation.ConversationTypeconversationTypepublic StringtargetIdpublic StringchannelIdpublic StringconversationTitlepublic StringportraitUrlpublic intunreadMessageCountpublic booleanisToppublic booleanisTopForTagpublic longoperationTimepublic StringsenderUserNamepublic Stringdraftpublic Conversation.ConversationNotificationStatusnotificationStatuspublic intmentionedCountpublic intpushNotificationLevelpublic IRongCoreEnum.UltraGroupChannelTypechannelTypepublic longfirstUnreadMsgSendTimepublic final static Creator<Conversation>CREATOR
-
Constructor Summary
Constructors Constructor Description Conversation()Default constructor. Conversation(Parcel in)
-
Method Summary
Modifier and Type Method Description Conversation.ConversationTypegetConversationType()Retrieves the conversation type. voidsetConversationType(Conversation.ConversationType conversationType)Sets the conversation type. StringgetTargetId()Retrieves the conversation ID. voidsetTargetId(String targetId)Sets the conversation ID. StringgetChannelId()The business identifier of the conversation to which the message belongs. voidsetChannelId(String channelId)Sets the business identifier of the conversation to which the message belongs. StringgetConversationTitle()Get the conversation title. voidsetConversationTitle(String conversationTitle)Sets the conversation title. StringgetPortraitUrl()Get the conversation avatar URL voidsetPortraitUrl(String portraitUrl)Sets the conversation avatar URL intgetUnreadMessageCount()Get the count of unread messages. voidsetUnreadMessageCount(int unreadMessageCount)Sets the unread message count. booleanisTop()Retrieves the pinned status. voidsetTop(boolean isTop)Sets the pinned status. booleanisTopForTag()Retrieves the pinned status of the current conversation under this tag. voidsetTopForTag(boolean isTopForTag)Sets the pinned status of the current conversation under this tag. longgetOperationTime()Gets the operation timestamp (Unix timestamp in milliseconds) for this conversation, used as the timestamp parameter when paginating through the conversation list. voidsetOperationTime(long operationTime)Sets the operation time for this conversation (Unix timestamp in milliseconds). StringgetSenderUserName()Retrieves the name of the user who sent the message. voidsetSenderUserName(String senderUserName)Sets the username of the message sender. StringgetDraft()Retrieves the draft present in the conversation. voidsetDraft(String draft)Sets the draft in the conversation. Conversation.ConversationNotificationStatusgetNotificationStatus()Retrieves the message notification status. voidsetNotificationStatus(Conversation.ConversationNotificationStatus notificationStatus)Sets the status for retrieving notification messages. intgetMentionedCount()Retrieves the count of unread messages in this conversation where you were mentioned. voidsetMentionedCount(int count)Sets the count of unread @ messages in this conversation. intgetPushNotificationLevel()Get the Do Not Disturb notification level voidsetPushNotificationLevel(int pushNotificationLevel)Sets the Do Not Disturb notification level IRongCoreEnum.UltraGroupChannelTypegetChannelType()Retrieves the channel type of the ultra group conversation. voidsetChannelType(IRongCoreEnum.UltraGroupChannelType channelType)Sets the channel type for the ultra group conversation longgetFirstUnreadMsgSendTime()Gets the timestamp of the first unread message in the conversation (Unix timestamp in milliseconds). voidsetFirstUnreadMsgSendTime(long firstUnreadMsgSendTime)Sets the timestamp of the first unread message in the conversation (Unix timestamp, in milliseconds). static Conversationobtain(Conversation.ConversationType type, String id, String title)Constructor. voidwriteToParcel(Parcel dest, int flags)intdescribeContents()ReceivedStatusgetReceivedStatus()Retrieves the receipt status of the last message in the conversation. voidsetReceivedStatus(ReceivedStatus receivedStatus)Sets the received status of the last message in the conversation. SentStatusgetSentStatus()Retrieves the send status of the last message in the conversation. voidsetSentStatus(SentStatus sentStatus)Sets the sending status of the last message in the conversation. longgetReceivedTime()Retrieves the receive time of the last message in the conversation (Unix timestamp in milliseconds). voidsetReceivedTime(long receivedTime)Sets the received time of the last message in the conversation (Unix timestamp in milliseconds). longgetSentTime()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. voidsetSentTime(long sentTime)Sets the sent time of the last message in the conversation (Unix timestamp in milliseconds). StringgetObjectName()Gets the name of the message object. voidsetObjectName(String objectName)Sets the name of the message object. StringgetSenderUserId()Retrieves the user ID of the message sender. voidsetSenderUserId(String senderUserId)Sets the user ID of the message sender. intgetLatestMessageId()Retrieves the ID of the last message in this conversation. voidsetLatestMessageId(int latestMessageId)Sets the ID of the last message in this conversation. MessageContentgetLatestMessage()Retrieves the content of the last message in the conversation. voidsetLatestMessage(MessageContent latestMessageContent)Sets the content of the last message in the conversation. intgetUnreadMentionedCount()Get the count of unread @ mentions in this conversation. intgetUnreadMentionedMeCount()Retrieves the count of unread messages in this conversation where only you are mentioned. MessageDirectiongetLatestMessageDirection()Retrieves the message direction. voidsetLatestMessageDirection(MessageDirection latestMessageDirection)Sets the message direction. StringgetLatestMessageExtra()Retrieve the additional information of the message. voidsetLatestMessageExtra(String latestMessageExtra)Sets the additional information for the message. StringgetLatestMessageUId()Retrieves the unique message ID from the server (globally unique within the same AppKey). voidsetLatestMessageUId(String latestMessageUId)Sets the server message unique ID (globally unique within the same AppKey). ReadReceiptInfogetLatestMessageReadReceiptInfo()Retrieves the read receipt status of the last message. voidsetLatestMessageReadReceiptInfo(ReadReceiptInfo latestMessageReadReceiptInfo)Sets the read receipt status of the last message MessageConfiggetLatestMessageConfig()Retrieves the message configuration. voidsetLatestMessageConfig(MessageConfig latestMessageConfig)Set message configuration booleanisLatestCanIncludeExpansion()Indicates whether the message can contain extended information. voidsetLatestCanIncludeExpansion(boolean latestCanIncludeExpansion)Sets whether the message can include extended information Map<String, String>getLatestExpansion()Retrieves the list of expansion information for the last message. voidsetLatestExpansion(Map<String, String> latestExpansion)Sets the latest message expansion information list. MessagegetMessage()Retrieves the latest message of the conversation voidsetMessage(Message latestMessage)The LatestMessage of the conversation voidsetMentionedMeCount(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.
-
-
-
-