EMGroup.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. /*!
  2. * \~chinese
  3. * @header EMGroup.h
  4. * @abstract 群组
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMGroup.h
  10. * @abstract Group
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMCommonDefs.h"
  16. #import "EMGroupOptions.h"
  17. /*!
  18. * \~chinese
  19. * 群组类型
  20. *
  21. * \~english
  22. * Group permission type
  23. */
  24. typedef enum{
  25. EMGroupPermissionTypeNone = -1, /*! \~chinese 未知 \~english Unknown */
  26. EMGroupPermissionTypeMember = 0, /*! \~chinese 普通成员 \~english Normal member */
  27. EMGroupPermissionTypeAdmin, /*! \~chinese 群组管理员 \~english Group admin */
  28. EMGroupPermissionTypeOwner, /*! \~chinese 群主 \~english Group owner */
  29. }EMGroupPermissionType;
  30. /*!
  31. * \~chinese
  32. * 群组
  33. *
  34. * \~english
  35. * Group
  36. */
  37. @interface EMGroup : NSObject
  38. /*!
  39. * \~chinese
  40. * 群组ID
  41. *
  42. * \~english
  43. * Group id
  44. */
  45. @property (nonatomic, copy, readonly) NSString *groupId;
  46. /*!
  47. * \~chinese
  48. * 群组的名称,需要获取群详情
  49. *
  50. * \~english
  51. * Subject of the group
  52. */
  53. @property (nonatomic, copy, readonly) NSString *groupName;
  54. /*!
  55. * \~chinese
  56. * 群组的描述,需要获取群详情
  57. *
  58. * \~english
  59. * Description of the group
  60. */
  61. @property (nonatomic, copy, readonly) NSString *description;
  62. /*!
  63. * \~chinese
  64. * 群组的公告,需要获取群公告
  65. *
  66. * \~english
  67. * Announcement of the group
  68. */
  69. @property (nonatomic, copy, readonly) NSString *announcement;
  70. /*!
  71. * \~chinese
  72. * 群组属性配置,需要获取群详情
  73. *
  74. * \~english
  75. * Setting options of group
  76. */
  77. @property (nonatomic, strong, readonly) EMGroupOptions *setting;
  78. /*!
  79. * \~chinese
  80. * 群组的所有者,拥有群的最高权限,需要获取群详情
  81. *
  82. * 群组的所有者只有一人
  83. *
  84. * \~english
  85. * Owner of the group
  86. *
  87. * Each group only has one owner
  88. */
  89. @property (nonatomic, copy, readonly) NSString *owner;
  90. /*!
  91. * \~chinese
  92. * 群组的管理者,拥有群的最高权限,需要获取群详情
  93. *
  94. *
  95. * \~english
  96. * Admins of the group
  97. *
  98. */
  99. @property (nonatomic, copy, readonly) NSArray *adminList;
  100. /*!
  101. * \~chinese
  102. * 群组的成员列表,需要获取群详情
  103. *
  104. * \~english
  105. * Member list of the group
  106. */
  107. @property (nonatomic, copy, readonly) NSArray *memberList;
  108. /*!
  109. * \~chinese
  110. * 群组的黑名单,需要先调用获取群黑名单方法
  111. *
  112. * 需要owner权限才能查看,非owner返回nil
  113. *
  114. * \~english
  115. * Group‘s blacklist of blocked users
  116. *
  117. * Need owner's authority to access, return nil if user is not the group owner.
  118. */
  119. @property (nonatomic, strong, readonly) NSArray *blacklist;
  120. /*!
  121. * \~chinese
  122. * 群组的被禁言列表
  123. *
  124. * 需要owner权限才能查看,非owner返回nil
  125. *
  126. * \~english
  127. * List of muted members
  128. *
  129. * Need owner's authority to access, return nil if user is not the group owner.
  130. */
  131. @property (nonatomic, strong, readonly) NSArray *muteList;
  132. /*!
  133. * \~chinese
  134. * 聊天室的白名单列表<NSString>
  135. *
  136. * 需要owner权限才能查看,非owner返回nil
  137. *
  138. * \~english
  139. * List of whitelist members<NSString>
  140. *
  141. * Need owner's authority to access, return nil if user is not the group owner.
  142. */
  143. @property (nonatomic, strong, readonly) NSArray *whiteList;
  144. /*!
  145. * \~chinese
  146. * 群共享文件列表
  147. *
  148. * \~english
  149. * List of shared file
  150. */
  151. @property (nonatomic, strong, readonly) NSArray *sharedFileList;
  152. /*!
  153. * \~chinese
  154. * 此群组是否接收消息推送通知
  155. *
  156. * \~english
  157. * Is Apple Push Notification Service enabled for group
  158. */
  159. @property (nonatomic, readonly) BOOL isPushNotificationEnabled;
  160. /*!
  161. * \~chinese
  162. * 此群是否为公开群,需要获取群详情
  163. *
  164. * \~english
  165. * Whether is a public group
  166. */
  167. @property (nonatomic, readonly) BOOL isPublic;
  168. /*!
  169. * \~chinese
  170. * 是否屏蔽群消息
  171. *
  172. * \~english
  173. * Whether block the current group‘s messages
  174. */
  175. @property (nonatomic, readonly) BOOL isBlocked;
  176. /*!
  177. * \~chinese
  178. * 当前登录账号的群成员类型
  179. *
  180. * \~english
  181. * The group membership type of the current login account
  182. */
  183. @property (nonatomic, readonly) EMGroupPermissionType permissionType;
  184. /*!
  185. * \~chinese
  186. * 群组的所有成员(包含owner、admins和members)
  187. *
  188. * \~english
  189. * All occupants of the group, includes the group owner and admins and all other group members
  190. */
  191. @property (nonatomic, strong, readonly) NSArray *occupants;
  192. /*!
  193. * \~chinese
  194. * 群组当前的成员数量,需要获取群详情, 包括owner, admins, members
  195. *
  196. * \~english
  197. * The total number of group occupants, include owner, admins, members
  198. */
  199. @property (nonatomic, readonly) NSInteger occupantsCount;
  200. /**
  201. * \~chinese
  202. * 群组成员是否全部被静音
  203. *
  204. * \~english
  205. * The group is all members muted.
  206. */
  207. @property (nonatomic, readonly) BOOL isMuteAllMembers;
  208. /*!
  209. * \~chinese
  210. * 获取群组实例,如果不存在则创建
  211. *
  212. * @param aGroupId 群组ID
  213. *
  214. * @result 群组实例
  215. *
  216. * \~english
  217. * Get group instance, create a instance if it does not exist
  218. *
  219. * @param aGroupId Group id
  220. *
  221. * @result Group instance
  222. */
  223. + (instancetype)groupWithId:(NSString *)aGroupId;
  224. #pragma mark - EM_DEPRECATED_IOS 3.3.0
  225. /*!
  226. * \~chinese
  227. * 群组的成员列表,需要获取群详情
  228. *
  229. * \~english
  230. * Member list of the group
  231. */
  232. @property (nonatomic, copy, readonly) NSArray *members EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -memberList");
  233. /*!
  234. * \~chinese
  235. * 群组的黑名单,需要先调用获取群黑名单方法
  236. *
  237. * 需要owner权限才能查看,非owner返回nil
  238. *
  239. * \~english
  240. * Group‘s blacklist of blocked users
  241. *
  242. * Need owner's authority to access, return nil if user is not the group owner.
  243. */
  244. @property (nonatomic, strong, readonly) NSArray *blackList EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -blacklist");
  245. /*!
  246. * \~chinese
  247. * 群组当前的成员数量,需要获取群详情, 包括owner, admins, members
  248. *
  249. * \~english
  250. * The total number of group members, include owner, admins, members
  251. */
  252. @property (nonatomic, readonly) NSInteger membersCount EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -occupantsCount");
  253. /*!
  254. * \~chinese
  255. * 群组的主题,需要获取群详情
  256. *
  257. * \~english
  258. * Subject of the group
  259. */
  260. @property (nonatomic, copy, readonly) NSString *subject EM_DEPRECATED_IOS(3_1_0, 3_6_2, "Use -groupName");
  261. #pragma mark - EM_DEPRECATED_IOS < 3.2.3
  262. /*!
  263. * \~chinese
  264. * 初始化群组实例
  265. *
  266. * 请使用+groupWithId:方法
  267. *
  268. * @result nil
  269. *
  270. * \~english
  271. * Initialize a group instance
  272. *
  273. * Please use [+groupWithId:]
  274. *
  275. * @result nil
  276. */
  277. - (instancetype)init __deprecated_msg("Use +groupWithId:");
  278. /*!
  279. * \~chinese
  280. * 群组的黑名单,需要先调用获取群黑名单方法
  281. *
  282. * 需要owner权限才能查看,非owner返回nil
  283. *
  284. * \~english
  285. * Group‘s blacklist of blocked users
  286. *
  287. * Need owner's authority to access, return nil if user is not the group owner.
  288. */
  289. @property (nonatomic, strong, readonly) NSArray *bans __deprecated_msg("Use - blackList");
  290. @end