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

Public Member Functions

String getConversationID ()
 
int getType ()
 
String getUserID ()
 
String getGroupID ()
 
String getShowName ()
 
String getFaceUrl ()
 
int getRecvOpt ()
 
String getGroupType ()
 
int getUnreadCount ()
 
V2TIMMessage getLastMessage ()
 
String getDraftText ()
 
long getDraftTimestamp ()
 
List< V2TIMGroupAtInfogetGroupAtInfoList ()
 
boolean isPinned ()
 
long getOrderKey ()
 
List< Long > getMarkList ()
 
String getCustomData ()
 
List< String > getConversationGroupList ()
 
long getC2CReadTimestamp ()
 
long getGroupReadSequence ()
 

Static Public Attributes

static final int CONVERSATION_TYPE_INVALID = 0
 
static final int V2TIM_C2C = 1
 
static final int V2TIM_GROUP = 2
 
static long V2TIM_CONVERSATION_MARK_TYPE_STAR = 0x1
 
static long V2TIM_CONVERSATION_MARK_TYPE_UNREAD = 0x1 << 1
 
static long V2TIM_CONVERSATION_MARK_TYPE_FOLD = 0x1 << 2
 
static long V2TIM_CONVERSATION_MARK_TYPE_HIDE = 0x1 << 3
 

Member Function Documentation

◆ getConversationID()

String getConversationID ( )
inline

Get the conversation ID

Returns
Conversation ID

◆ getType()

int getType ( )
inline

Get the conversation type

Returns
Conversation type

◆ getUserID()

String getUserID ( )
inline

If the conversation type is one-to-one chat, the userID stores the user ID of the peer; otherwise, the userID is null

Returns
User's userID

◆ getGroupID()

String getGroupID ( )
inline

If the conversation type is group chat, the groupID stores the current group ID; otherwise, the groupID is null

Returns
Group ID

◆ getShowName()

String getShowName ( )
inline

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

  • Group: group name -> group ID
  • One-to-one: peer's remarks -> peer's nickname -> peer's userID
Returns
Display name

◆ getFaceUrl()

String getFaceUrl ( )
inline

Get the conversation display profile photo

  • Group: group profile photo
  • One-to-one: peer's profile photo
Returns

◆ getRecvOpt()

int getRecvOpt ( )
inline

Get the message receiving option (Receive | Receive but not notify | Not receive)

Returns

◆ getGroupType()

String getGroupType ( )
inline

Get the group type (valid for group conversations only)

Returns

◆ getUnreadCount()

int getUnreadCount ( )
inline

Get the unread count

Returns

◆ getLastMessage()

V2TIMMessage getLastMessage ( )
inline

Get the last message of the conversation

Attention
For versions earlier than 5.5.892, please use "lastMessage -> timestamp" to sort conversations. The later the timestamp, the higher the order of the conversation.

◆ getDraftText()

String getDraftText ( )
inline

Get a draft message whose editing is not finished (a draft message is stored locally only and will get lost after the app is uninstalled and reinstalled)

Returns
Return the draft content. If the draft content does not exist or is incorrect, return null

◆ getDraftTimestamp()

long getDraftTimestamp ( )
inline

Get UTC timestamp when the draft was last set

Returns
Time, in seconds

◆ getGroupAtInfoList()

List<V2TIMGroupAtInfo> getGroupAtInfoList ( )
inline

Get the @ information list of a group conversation, which is used to display "someone@me" or "@All" notifications

◆ isPinned()

boolean isPinned ( )
inline

Whether to pin on top

◆ getOrderKey()

long getOrderKey ( )
inline

orderKey (supported only in 5.5.892 and later)

Attention
  • The sorting field orderKey is a number that increases linearly according to the conversation activation time (note: this is not a timestamp because multiple conversations may be activated at the same time).
  • For 5.5.892 and later versions, it is recommended that you use this field to sort all conversations. The larger the orderKey value, the higher the order of the conversation.
  • When you clear all messages in a conversation at a time or delete all messages in the conversation one by one, the lastMessage of the conversation becomes empty, but the orderKey of the conversation will not change. In that case, if you want to keep the sorting positions of conversations unchanged, you can use this field to sort all conversations.

◆ getMarkList()

List<Long> getMarkList ( )
inline

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

◆ getCustomData()

String getCustomData ( )
inline

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

◆ getConversationGroupList()

List<String> getConversationGroupList ( )
inline

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

◆ getC2CReadTimestamp()

long getC2CReadTimestamp ( )
inline

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)

◆ getGroupReadSequence()

long getGroupReadSequence ( )
inline

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

Field Documentation

◆ CONVERSATION_TYPE_INVALID

final int CONVERSATION_TYPE_INVALID = 0
static

Invalid type

◆ V2TIM_C2C

final int V2TIM_C2C = 1
static

One-to-one chat

◆ V2TIM_GROUP

final int V2TIM_GROUP = 2
static

Group chat

◆ V2TIM_CONVERSATION_MARK_TYPE_STAR

long V2TIM_CONVERSATION_MARK_TYPE_STAR = 0x1
static

Mark a conversation as star

◆ V2TIM_CONVERSATION_MARK_TYPE_UNREAD

long V2TIM_CONVERSATION_MARK_TYPE_UNREAD = 0x1 << 1
static

Mark a conversation as unread

◆ V2TIM_CONVERSATION_MARK_TYPE_FOLD

long V2TIM_CONVERSATION_MARK_TYPE_FOLD = 0x1 << 2
static

Fold a conversation

◆ V2TIM_CONVERSATION_MARK_TYPE_HIDE

long V2TIM_CONVERSATION_MARK_TYPE_HIDE = 0x1 << 3
static

Hide a conversation