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.
V2TIMConversationListener

Public Member Functions

 V2TIMConversationListener ()
 
virtual ~V2TIMConversationListener ()
 
virtual void OnSyncServerStart ()
 
virtual void OnSyncServerFinish ()
 
virtual void OnSyncServerFailed ()
 
virtual void OnNewConversation (const V2TIMConversationVector &conversationList)
 
virtual void OnConversationChanged (const V2TIMConversationVector &conversationList)
 
virtual void OnConversationDeleted (const V2TIMStringVector &conversationIDList)
 
virtual void OnTotalUnreadMessageCountChanged (uint64_t totalUnreadCount)
 
virtual void OnUnreadMessageCountChangedByFilter (const V2TIMConversationListFilter &filter, uint64_t totalUnreadCount)
 
virtual void OnConversationGroupCreated (const V2TIMString &groupName, const V2TIMConversationVector &conversationList)
 
virtual void OnConversationGroupDeleted (const V2TIMString &groupName)
 
virtual void OnConversationGroupNameChanged (const V2TIMString &oldName, const V2TIMString &newName)
 
virtual void OnConversationsAddedToGroup (const V2TIMString &groupName, const V2TIMConversationVector &conversationList)
 
virtual void OnConversationsDeletedFromGroup (const V2TIMString &groupName, const V2TIMConversationVector &conversationList, uint32_t reason)
 
virtual void OnConversationsDeletedFromGroup (const V2TIMString &groupName, const V2TIMConversationVector &conversationList)
 

Constructor & Destructor Documentation

◆ V2TIMConversationListener()

◆ ~V2TIMConversationListener()

virtual ~V2TIMConversationListener ( )
virtual

Member Function Documentation

◆ OnSyncServerStart()

virtual void OnSyncServerStart ( )
inlinevirtual

The SDK started to synchronize server conversations. The SDK automatically synchronizes server conversations after a successful login or network reconnection. You can monitor this event and display information about the progress on the UI.

◆ OnSyncServerFinish()

virtual void OnSyncServerFinish ( )
inlinevirtual

Server conversations have been synchronized. If a conversation changes, the SDK will notify you via OnNewConversation or OnConversationChanged.

◆ OnSyncServerFailed()

virtual void OnSyncServerFailed ( )
inlinevirtual

Server conversation synchronization failed

◆ OnNewConversation()

virtual void OnNewConversation ( const V2TIMConversationVector conversationList)
inlinevirtual

A new conversation was added. This occurs when, for example, the user received a one-to-one chat message from a new colleague or was added to a new group. You can resort conversations based on "orderKey".

◆ OnConversationChanged()

virtual void OnConversationChanged ( const V2TIMConversationVector conversationList)
inlinevirtual

The key information of some conversations changed. This occurs when, for example, the unread message count of a conversation changes or the last message is updated. You can resort conversations based on "orderKey".

◆ OnConversationDeleted()

virtual void OnConversationDeleted ( const V2TIMStringVector conversationIDList)
inlinevirtual

Conversations are deleted. (supported by 7.2 and later versions)

Attention
conversationIDList indicates the deleted conversations' unique IDs. 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").

◆ OnTotalUnreadMessageCountChanged()

virtual void OnTotalUnreadMessageCountChanged ( uint64_t  totalUnreadCount)
inlinevirtual

Notify the changes of the total unread message count of all conversations (supported by 5.3.425 and later versions)

Attention
  • After you call GetTotalUnreadMessageCount to obtain the total number of unread messages for all conversations, the newest value will be notified to you through this callback when unread message count of any conversation changed.
  • The total unread message count excludes the unread message count of muted conversations (conversations whose message receiving option is V2TIM_NOT_RECEIVE_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE_EXCEPT_AT).

◆ OnUnreadMessageCountChangedByFilter()

virtual void OnUnreadMessageCountChangedByFilter ( const V2TIMConversationListFilter filter,
uint64_t  totalUnreadCount 
)
inlinevirtual

Notify the changes of the total unread message count of conversations by filter (supported by 7.0 and later versions)

Attention
  • You can call subscribeUnreadMessageCountByFilter to monitor the total unread message count of specified conversations. When the count changes, the SDK will send you the new count via this callback.
  • The filter parameter in this callback is the same as the filter you specify when calling subscribeUnreadMessageCountByFilter. It includes three fields: conversationType, conversationGroup, and markType. If you have specified multiple filters, you can tell which conversations' unread message count has changed based on the three fields from the callback you receive.
  • The total unread message count excludes the unread message count of muted conversations (conversations whose message receiving option is V2TIM_NOT_RECEIVE_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE_EXCEPT_AT).

◆ OnConversationGroupCreated()

virtual void OnConversationGroupCreated ( const V2TIMString groupName,
const V2TIMConversationVector conversationList 
)
inlinevirtual

Conversation group has been created.

◆ OnConversationGroupDeleted()

virtual void OnConversationGroupDeleted ( const V2TIMString groupName)
inlinevirtual

Conversation group has been deleted.

◆ OnConversationGroupNameChanged()

virtual void OnConversationGroupNameChanged ( const V2TIMString oldName,
const V2TIMString newName 
)
inlinevirtual

Conversation group name has been changed.

◆ OnConversationsAddedToGroup()

virtual void OnConversationsAddedToGroup ( const V2TIMString groupName,
const V2TIMConversationVector conversationList 
)
inlinevirtual

New conversations have been added to this conversation group.

◆ OnConversationsDeletedFromGroup() [1/2]

virtual void OnConversationsDeletedFromGroup ( const V2TIMString groupName,
const V2TIMConversationVector conversationList,
uint32_t  reason 
)
inlinevirtual

Conversations have been deleted from this conversation group.

Attention
  • reason : Indicates the reason why the conversation was deleted from the conversation group, its values are:
  • When reason is 0, it means that it is triggered by the user actively calling deleteConversationsFromGroup.
  • When reason is 1, it means that the number of conversations added to the conversation group exceeds 1000, and the earliest conversation added to the group will be eliminated.

◆ OnConversationsDeletedFromGroup() [2/2]

virtual void OnConversationsDeletedFromGroup ( const V2TIMString groupName,
const V2TIMConversationVector conversationList 
)
inlinevirtual

Conversations have been deleted from this conversation group.(This API will be deprecated. Please call onConversationsDeletedFromGroup(const V2TIMString &, const V2TIMConversationVector &, uint32_t) instead)