TIMConvGetUnreadMessageCountByFilter

Introduction

Get unread message count by filter

The unread total is subtracted from the unread count for sessions set to Do Not Disturb, that is, sessions with the message receive option set to kTIMRecvMsgOpt_Not_Receive or kTIMRecvMsgOpt_Not_Notify.

Do not fill in next_seq and count in TIMConversationListFilter

Parameter details

Parameter name Parameter type Required Description
TIMConversationListFilter TIMConversationListFilter yes Get unread message count by filter param

Returned template

Promise<commonResult<totalUnreadCountResult>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: totalUnreadCountResult | undefined;
    json_params?: totalUnreadCountResult | undefined; // 兼容
    user_data?: string | undefined;
}

Return value details

name type description
code TIMResultTIMErrCode Request result: Error codes. 0 means success.
desc string | undefined The description of the error. It will be empty if success.
json_param totalUnreadCountResult | undefined Return value of calling API
json_params totalUnreadCountResult | undefined Return value of calling API. Compatible field, which is returned in some cases.
user_data string | undefined ImSDK is responsible for transporting user-defined data without any processing

Code example

import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();

let param:TIMConversationListFilter = {
    params: {
        conversation_list_filter_conv_type:null,
        conversation_list_filter_mark_type: 0x1,
        conversation_list_filter_conversation_group: null
    }
}
timRenderInstance.TIMConvGetUnreadMessageCountByFilter(param)

results matching ""

    No results matching ""