NIMChatroomNotificationContent.h
5.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
//
// NIMChatroomNotificationContent.h
// NIMLib
//
// Created by Netease
// Copyright © 2016年 Netease. All rights reserved.
//
#import "NIMNotificationContent.h"
NS_ASSUME_NONNULL_BEGIN
/**
* 聊天室操作类型
*/
typedef NS_ENUM(NSInteger, NIMChatroomEventType){
/**
* 成员进入聊天室
*/
NIMChatroomEventTypeEnter = 301,
/**
* 成员离开聊天室
*/
NIMChatroomEventTypeExit = 302,
/**
* 成员被拉黑
*/
NIMChatroomEventTypeAddBlack = 303,
/**
* 成员被取消拉黑
*/
NIMChatroomEventTypeRemoveBlack = 304,
/**
* 成员被设置禁言
*/
NIMChatroomEventTypeAddMute = 305,
/**
* 成员被取消禁言
*/
NIMChatroomEventTypeRemoveMute = 306,
/**
* 设置为管理员
*/
NIMChatroomEventTypeAddManager = 307,
/**
* 移除管理员
*/
NIMChatroomEventTypeRemoveManager = 308,
/**
* 设置为固定成员
*/
NIMChatroomEventTypeAddCommon = 309,
/**
* 取消固定成员
*/
NIMChatroomEventTypeRemoveCommon = 310,
/**
* 聊天室被关闭
*/
NIMChatroomEventTypeClosed = 311,
/**
* 聊天室信息更新
*/
NIMChatroomEventTypeInfoUpdated = 312,
/**
* 聊天室成员被踢
*/
NIMChatroomEventTypeKicked = 313,
/**
* 聊天室成员被临时禁言
*/
NIMChatroomEventTypeAddMuteTemporarily = 314,
/**
* 聊天室成员被解除临时禁言
*/
NIMChatroomEventTypeRemoveMuteTemporarily = 315,
/**
* 聊天室成员主动更新了聊天室的角色信息
*/
NIMChatroomEventTypeMemberUpdateInfo = 316,
/**
* 聊天室通用队列变更的通知
*/
NIMChatroomEventTypeQueueChange = 317,
/**
* 聊天室被禁言了,只有管理员可以发言,其他人都处于禁言状态
*/
NIMChatroomEventTypeRoomMuted = 318,
/**
* 聊天室不在禁言状态
*/
NIMChatroomEventTypeRoomUnMuted = 319,
/**
* 聊天室通用队列批量变更的通知
*/
NIMChatroomEventTypeQueueBatchChange = 320,
};
/**
* 聊天室队列变更类型
*/
typedef NS_ENUM(NSInteger, NIMChatroomQueueChangeType){
/**
* 无效或未知变更类型
*/
NIMChatroomQueueChangeTypeInvalid = 0,
/**
* 新增元素
*/
NIMChatroomQueueChangeTypeOffer = 1,
/**
* 取出元素
*/
NIMChatroomQueueChangeTypePoll = 2,
/**
* 清空元素
*/
NIMChatroomQueueChangeTypeDrop = 3,
};
/**
* 聊天室队列批量变更类型
*/
typedef NS_ENUM(NSInteger, NIMChatroomQueueBatchChangeType){
/**
* 无效或未知变更类型
*/
NIMChatroomQueueBatchChangeTypeInvalid = 0,
/**
* 部分批量清理操作(发生在提交元素的用户掉线时,清理这个用户对应的key)
*/
NIMChatroomQueueBatchChangeTypePartClear = 4,
};
/**
* 通知事件包含的聊天室成员
*/
@interface NIMChatroomNotificationMember : NSObject
/**
* 聊天室成员ID
*/
@property (nullable,nonatomic,copy,readonly) NSString *userId;
/**
* 聊天室成员昵称
*/
@property (nullable,nonatomic,copy,readonly) NSString *nick;
@end
/**
* 聊天室通知内容
*/
@interface NIMChatroomNotificationContent : NIMNotificationContent
/**
* 聊天室通知事件类型
*/
@property (nonatomic,assign,readonly) NIMChatroomEventType eventType;
/**
* 操作者
*/
@property (nullable,nonatomic,copy,readonly) NIMChatroomNotificationMember *source;
/**
* 被操作者
*/
@property (nullable,nonatomic,copy,readonly) NSArray<NIMChatroomNotificationMember *> *targets;
/**
* 通知信息
*/
@property (nullable,nonatomic,copy,readonly) NSString *notifyExt;
/**
* 拓展信息
* @discusssion 不同的聊天室通知有不同的扩展信息
* NIMChatroomEventTypeAddMuteTemporarily/NIMChatroomEventTypeRemoveMuteTemporarily 类型: 拓展信息为NSNumber,表示临时禁言时长
*
* NIMChatroomEventTypeEnter 类型: 扩展信息为 NSDictionary , KEY 值为 NIMChatroomEventInfoMutedKey ,NIMChatroomEventInfoTempMutedKey, NIMChatroomEventInfoTempMutedDurationKey
*
* NIMChatroomEventTypeQueueChange 类型: 扩展信息为 NSDictionary, KEY 值为 NIMChatroomEventInfoQueueChangeTypeKey , NIMChatroomEventInfoQueueChangeItemKey, NIMChatroomEventInfoQueueChangeItemValueKey
*/
@property (nullable,nonatomic,copy,readonly) id ext;
@end
/**
* 是否是禁言状态
*/
extern NSString *const NIMChatroomEventInfoMutedKey;
/**
* 是否为临时禁言状态
*/
extern NSString *const NIMChatroomEventInfoTempMutedKey;
/**
* 临时禁言时长
*/
extern NSString *const NIMChatroomEventInfoTempMutedDurationKey;
/**
* 聊天室变更类型
*/
extern NSString *const NIMChatroomEventInfoQueueChangeTypeKey;
/**
* 聊天室变更元素
*/
extern NSString *const NIMChatroomEventInfoQueueChangeItemKey;
/**
* 聊天室批量变更元素,为包含多个键值对的字典
*/
extern NSString *const NIMChatroomEventInfoQueueChangeItemsKey;
/**
* 聊天室变更元素的值
*/
extern NSString *const NIMChatroomEventInfoQueueChangeItemValueKey;
NS_ASSUME_NONNULL_END