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)
 

Constructor & Destructor Documentation

◆ V2TIMConversationListener()

◆ ~V2TIMConversationListener()

virtual ~V2TIMConversationListener ( )
virtual

Member Function Documentation

◆ OnSyncServerStart()

virtual void OnSyncServerStart ( )
inlinevirtual

When server conversation synchronization starts, the SDK automatically synchronizes server conversations after a successful login or network reconnection. You can monitor such an event and display the event progress on the UI.

◆ OnSyncServerFinish()

virtual void OnSyncServerFinish ( )
inlinevirtual

When server conversation synchronization is completed, if there are conversation changes, the SDK notifies users of the changes via onNewConversation or onConversationChanged callback.

◆ OnSyncServerFailed()

virtual void OnSyncServerFailed ( )
inlinevirtual

Server conversation synchronization failed

◆ OnNewConversation()

virtual void OnNewConversation ( const V2TIMConversationVector conversationList)
inlinevirtual

If there is a new conversation (such as receiving a one-to-one chat message from a new colleague or being added to a new group), use "lastMessage -> timestamp" to sort the conversation list again.

◆ OnConversationChanged()

virtual void OnConversationChanged ( const V2TIMConversationVector conversationList)
inlinevirtual

If the key information of some conversations changes (for example, the unread count changes, or the last message is updated), use "lastMessage -> timestamp" to sort the conversation list again.

◆ OnConversationDeleted()

virtual void OnConversationDeleted ( const V2TIMStringVector conversationIDList)
inlinevirtual

Notify conversations are deleted (supported by 7.2 and later versions)

Attention
conversationIDList indicates the list of deleted conversation unique IDs. For one-to-one chats, the value format is "c2c_userID". For group chats, the value format is "group_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 Do-Not-Disturb conversations (conversations whose message receiving option is V2TIM_NOT_RECEIVE_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE).

◆ 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 listen the changes of total unread message count for conversations by filter, then the SDK will notify you with the latest value through this callback.
  • When you subscribe changing notification for total unread message count with multiple conversation filters, you can distinguish which types of conversations's unread messages count has changed by judging the three fields of conversationType, markType, and conversationGroup specified in the filter parameter.
  • The total unread message count excludes the unread message count of Do-Not-Disturb conversations (conversations whose message receiving option is V2TIM_NOT_RECEIVE_MESSAGE or V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE).

◆ 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 chaned.

◆ OnConversationsAddedToGroup()

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

New conversations have been added to this conversation group.

◆ OnConversationsDeletedFromGroup()

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

Conversations have been deleted from this conversation group.