When a user creates a one-to-one or group chat, and a message is sent or received in it, a conversation will be created.
In the Tencent Cloud Chat SDK, the conversation management class is
V2TIMManager(Conversation)(iOS and macOS). You can use the conversation management class APIs to display/update the conversation list, update the unread count, pin a conversation to the top, make a conversation draft, and mute message notifications.
The conversation class is
V2TIMConversation (Android / iOS and macOS / Windows), which defines the following content:
|type||Conversation type||See the definition of
|conversationID||Unique conversation ID||It is in the format of
|userID||User ID of the message receiver||
|showName||Displayed conversation name||The name of a group conversation is displayed in the following order of priority: group name > group ID;
The name of a one-to-one conversation is displayed in the following order of priority: friend remarks of the message receiver > nickname of the message receiver >
|faceUrl||Displayed conversation profile photo||It is the group profile photo for a group chat or the profile photo of the message receiver for a one-to-one chat.|
|unreadCount||Unread message count of the conversation||For detailed directions, see Conversation Unread Count. It is invalid and defaults to
|recvOpt||Message receiving option||See the definition of
|lastMessage||Last message in the conversation||For detailed directions, see Conversation List.|
|groupAtInfolist||List of @ information in the group conversation||Generally, it is used to display the notifications of "someone@me" and "@all".|
|draftText||Draft information||The draft information can be set by calling the
|draftTimestamp||Draft editing time||It is automatically generated when a draft is set.|
|isPinned||Whether to pin the conversation to the top||For detailed directions, see Pinning Conversation to the Top.|
|orderKey||Field for sorting conversations||For detailed directions, see Conversation List.|
|markList||Conversation mark list||For the use directions, see Conversation Mark. This attribute is supported from v6.5.|
|customData||Custom conversation data||To set custom data, call the
|conversationGroupList||List of groups to which the conversation belongs||For the use directions, see Conversation Group. This attribute is supported from v6.5.|
There is no limit on the number of locally stored conversations.
Up to 100 conversations can be stored in the cloud. To increase this limit, upgrade to the Ultimate edition. Then you can set the limit to 500 in the console.
If the information of a conversation has not been updated for a long time, the conversation can be stored in the cloud for up to seven days.
Locally stored conversations may not always be consistent with those stored in the cloud. If you do not call the
deleteConversation API to delete the local conversations, these conversations will always exist. However, at most 100 conversations can be stored in the cloud. In addition, if the information of a conversation has not been updated for a long time, this conversation can be stored in the cloud for at most seven days. Therefore, local conversations displayed on different mobile phones may be inconsistent with each other.