NIMSDK-iOS
载入中...
搜索中...
未找到
NIMRecentSession.h
浏览该文件的文档.
1//
2// NIMRecentSession.h
3// NIMLib
4//
5// Created by Netease.
6// Copyright (c) 2015 Netease. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12
13@class NIMMessage;
14@class NIMSession;
16
17/**
18* 最后一条消息的类型。
19*/
20typedef NS_ENUM(NSInteger, NIMLastMsgType){
21 /*
22 * 常规Message,NIMMessage类型,lastMessage字段
23 */
25 /*
26 * 撤回通知,NIMRevokeMessageNotification类型,lastNotification字段
27 */
29};
30
31
32
33/**
34 * 最近会话
35 */
36@interface NIMRecentSession : NSObject
37
38/**
39 * 当前会话
40 */
41@property (nullable,nonatomic,readonly,copy) NIMSession *session;
42
43/**
44 * 最后一条消息
45 */
46@property (nullable,nonatomic,strong) NIMMessage *lastMessage;
47
48/**
49 * 未读消息数
50 */
51@property (nonatomic,readonly,assign) NSInteger unreadCount;
52
53/**
54 * 本地扩展
55 */
56@property (nullable,nonatomic,readonly,copy) NSDictionary *localExt;
57
58/**
59 * 服务端会话的最新更新时间,本地会话无效
60 */
61@property (nonatomic,readonly,assign) NSTimeInterval updateTime;
62
63
64/**
65 * 会话服务扩展字段(本地会话该字段无效)
66 */
67@property (nonatomic,copy) NSString *serverExt;
68
69/**
70* 最后一条消息的类型(本地会话该字段无效)
71*/
72@property (nonatomic, readonly, assign) NIMLastMsgType lastMessageType;
73
74/**
75* 最后一条撤回通知(本地会话该字段无效)
76* lastMessageType为NIMLastMsgTypeNormalMessage时,最后一条为普通消息,请使用lastMessage获取,本字段为nil
77* lastMessageType为NIMLastMsgTypeRevokeNotication时,lastMessage字段为nil,最后一条为撤回通知,请使用本字段获取
78*/
79@property (nullable, nonatomic, readonly, strong) NIMRevokeMessageNotification *lastRevokeNotification;
80
81@end
82
83
84/**
85 * 检索最近会话选项
86 */
87@interface NIMRecentSessionOption : NSObject
88
89/**
90 * 最后一条消息过滤
91 * @discusssion 最近会话里lastMessage为非过滤类型里的最后一条。例:@[@(NIMMessageTypeNotification)],
92 * 表示返回的最近会话里lastMessage是最后一条非NIMMessageTypeNotification类型的消息。
93 */
94@property (nonatomic, strong) NSArray<NSNumber *> *filterLastMessageTypes;
95
96@end
97
98/**
99 * 获取服务端会话列表可选参数
100 */
101@interface NIMFetchServerSessionOption : NSObject
102
103/**
104 * 最小时间戳,作为请求参数时表示增量获取Session列表,单位毫秒
105 */
106@property (nonatomic, assign) NSTimeInterval minTimestamp;
107
108/**
109 * 最大时间戳,翻页时使用, 单位毫秒,默认为当前时间
110 */
111@property (nonatomic, assign) NSTimeInterval maxTimestamp;
112
113/**
114 * 是否需要lastMsg,默认 YES
115 */
116@property (nonatomic, assign) BOOL needLastMessage;
117
118
119/**
120 * 结果集limit,最大100,默认100
121 */
122@property (nonatomic, assign) NSInteger limit;
123
124@end
125
126NS_ASSUME_NONNULL_END
NIMLastMsgType
Definition: NIMRecentSession.h:20
@ NIMLastMsgTypeNormalMessage
Definition: NIMRecentSession.h:24
@ NIMLastMsgTypeRevokeNotication
Definition: NIMRecentSession.h:28
Definition: NIMRecentSession.h:102
Definition: NIMMessage.h:90
Definition: NIMRecentSession.h:37
NIMLastMsgType lastMessageType
Definition: NIMRecentSession.h:72
NIMSession * session
Definition: NIMRecentSession.h:41
NSInteger unreadCount
Definition: NIMRecentSession.h:51
NSTimeInterval updateTime
Definition: NIMRecentSession.h:61
NIMMessage * lastMessage
Definition: NIMRecentSession.h:46
NSDictionary * localExt
Definition: NIMRecentSession.h:56
NIMRevokeMessageNotification * lastRevokeNotification
Definition: NIMRecentSession.h:79
NSString * serverExt
Definition: NIMRecentSession.h:67
Definition: NIMRecentSession.h:88
Definition: NIMRevokeMessageNotification.h:45
Definition: NIMSession.h:49