cleanConversationUnreadMessageCount method

  1. @override
Future<V2TimCallback> cleanConversationUnreadMessageCount({
  1. required String conversationID,
  2. required int cleanTimestamp,
  3. required int cleanSequence,
})
override

Implementation

@override
Future<V2TimCallback> cleanConversationUnreadMessageCount({
  required String conversationID,
  required int cleanTimestamp,
  required int cleanSequence,
}) async {
  if (conversationID.toLowerCase().startsWith("c2c")) {
    return await _v2timMessageManager.markC2CMessageAsRead({
      "userID": conversationID.replaceFirst("c2c_", ""),
    });
  } else if (conversationID.startsWith("group")) {
    return await _v2timMessageManager.markGroupMessageAsRead({
      "groupID": conversationID.replaceFirst("group_", ""),
    });
  } else {
    return V2TimCallback.fromJson({'code': -1, "desc": "conversationID format error"});
  }
}