IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMConversation

Detailed Description

Definition of V2TIMConversation.

Public Member Functions

 V2TIMConversation ()
 
 V2TIMConversation (const V2TIMConversation &conversation)
 
V2TIMConversationoperator= (const V2TIMConversation &conversation)
 
 ~V2TIMConversation ()
 

Data Fields

V2TIMConversationType type
 
V2TIMString conversationID
 
V2TIMString userID
 
V2TIMString groupID
 
V2TIMString groupType
 
V2TIMString showName
 
V2TIMString faceUrl
 
int unreadCount
 
V2TIMReceiveMessageOpt recvOpt
 
V2TIMMessagelastMessage
 
V2TIMGroupAtInfoVector groupAtInfolist
 
V2TIMString draftText
 
uint64_t draftTimestamp
 
bool isPinned
 
uint64_t orderKey
 
V2TIMUInt64Vector markList
 
V2TIMBuffer customData
 
V2TIMStringVector conversationGroupList
 
uint64_t c2cReadTimestamp
 
uint64_t groupReadSequence
 

Constructor & Destructor Documentation

◆ V2TIMConversation() [1/2]

◆ V2TIMConversation() [2/2]

V2TIMConversation ( const V2TIMConversation conversation)

◆ ~V2TIMConversation()

Member Function Documentation

◆ operator=()

V2TIMConversation& operator= ( const V2TIMConversation conversation)

Field Documentation

◆ type

Conversation type.

◆ conversationID

V2TIMString conversationID

Unique ID of a conversation. For one-to-one chats, the value format is String.format("c2c_%s", "userID"). For group chats, the value format is String.format("group_%s", "groupID").

◆ userID

V2TIMString userID

If the conversation is a one-to-one chat, the user ID of the remote user will be returned; otherwise, null will be returned.

◆ groupID

V2TIMString groupID

If the conversation is a group chat, the group ID will be returned; otherwise, null will be returned.

◆ groupType

V2TIMString groupType

Group type of a conversation (valid for group conversations only)

◆ showName

V2TIMString showName

Get the conversation display name. The priorities are as follows:

  • Group: group name
  • One-to-one: Alias -> nickname -> user ID

◆ faceUrl

V2TIMString faceUrl

Conversation display profile photo.

  • Group: group profile photo
  • One-to-one: the remote user's profile photo

◆ unreadCount

int unreadCount

Count of unread messages in a conversation.

◆ recvOpt

Message receiving option for a conversation (Receive | Receive but not notify | Not receive)

◆ lastMessage

V2TIMMessage* lastMessage

Last message of a conversation

Attention
In versions earlier than 5.5.892, please sort conversations by "lastMessage -> timestamp". The later the timestamp, the higher a conversation will appear on the list.

◆ groupAtInfolist

V2TIMGroupAtInfoVector groupAtInfolist

Get a list of @ messages. This API can be used to notify a user when they are mentioned or all members are mentioned in a group.

◆ draftText

V2TIMString draftText

Get the draft of an unsent message (a draft message is stored locally only and will be lost after the app is reinstalled)

◆ draftTimestamp

uint64_t draftTimestamp

Get the UTC timestamp when the draft was last set.

◆ isPinned

bool isPinned

Whether to pin on top.

◆ orderKey

uint64_t orderKey

The field by which conversations are sorted (supported only in 5.5.892 and later)

Attention
  • The field orderKey is a number that increases linearly according to the last active time of conversations. Please note that this is not a timestamp because multiple conversations may be active at the same time.
  • For 5.5.892 and later versions, it is recommended that you sort all conversations by this field. The larger the orderKey value, the higher a conversation will appear on the list.
  • If all conversation messages are cleared or the messages of each conversation are deleted one by one, the lastMessage of the conversations will become empty, but orderKey will not change. Therefore, if you want to keep the sorting of conversations, you can use this field to sort conversations.

◆ markList

Mark list of the conversation(supported only in 6.5 and later versions)

◆ customData

V2TIMBuffer customData

Custom data of the conversation(supported only in 6.5 and later versions)

◆ conversationGroupList

V2TIMStringVector conversationGroupList

The conversation group list to which the conversation belongs.(supported only in 6.5 and later versions)

◆ c2cReadTimestamp

uint64_t c2cReadTimestamp

UTC timestamp of the latest message which has been read. Valid only for one-to-one chat.(supported only in 7.1 and later versions)

◆ groupReadSequence

uint64_t groupReadSequence

Sequence of the latest message which has been read. Valid only for group chat.(supported only in 7.1 and later versions)