NIMChatroomNotificationContent.h 5.3 KB

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