2025-10-09 16:48:46 +08:00

60 lines
1.3 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// NIMStatManager.h
// NIMLib
//
// Created by Netease.
// Copyright © 2022 Netease. All rights reserved.
//
#import <Foundation/Foundation.h>
@class NIMSessionStatOption;
@class NIMSessionStatContext;
@class NIMSessionStat;
NS_ASSUME_NONNULL_BEGIN
/**
* 消息表中消息数量不包括已经删除的NSInteger
*/
extern NSString *const NIMSessionStatKeyMessageCount;
/**
* 消息表中消息数量包括已经删除的NSInteger
*/
extern NSString *const NIMSessionStatKeyRawMessageCount;
/**
* 在最近会话中BOOL
*/
extern NSString *const NIMSessionStatKeyInRecentSession;
/**
* 会话统计回调block
* @param context 统计上下文信息
* @param stat 统计信息
* @param error 错误,如果成功则为nil
* @param stop 控制是否停止
*/
typedef void(^NIMSessionStatBlock)(NIMSessionStatContext* context,
NIMSessionStat* __nullable stat,
NSError* __nullable error,
BOOL * stop);
/**
* 统计协议
*/
@protocol NIMStatManager <NSObject>
/**
* 会话统计
* @param option 统计选项
* @param receiver 统计信息接收block
*/
- (BOOL)statSessions:(nullable NIMSessionStatOption *)option
receiver:(NIMSessionStatBlock)receiver;
@end
NS_ASSUME_NONNULL_END