EMGroup.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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. * 群共享文件列表
  135. *
  136. * \~english
  137. * List of shared file
  138. */
  139. @property (nonatomic, strong, readonly) NSArray *sharedFileList;
  140. /*!
  141. * \~chinese
  142. * 此群组是否接收消息推送通知
  143. *
  144. * \~english
  145. * Is Apple Push Notification Service enabled for group
  146. */
  147. @property (nonatomic, readonly) BOOL isPushNotificationEnabled;
  148. /*!
  149. * \~chinese
  150. * 此群是否为公开群,需要获取群详情
  151. *
  152. * \~english
  153. * Whether is a public group
  154. */
  155. @property (nonatomic, readonly) BOOL isPublic;
  156. /*!
  157. * \~chinese
  158. * 是否屏蔽群消息
  159. *
  160. * \~english
  161. * Whether block the current group‘s messages
  162. */
  163. @property (nonatomic, readonly) BOOL isBlocked;
  164. /*!
  165. * \~chinese
  166. * 当前登录账号的群成员类型
  167. *
  168. * \~english
  169. * The group membership type of the current login account
  170. */
  171. @property (nonatomic, readonly) EMGroupPermissionType permissionType;
  172. /*!
  173. * \~chinese
  174. * 群组的所有成员(包含owner、admins和members)
  175. *
  176. * \~english
  177. * All occupants of the group, includes the group owner and admins and all other group members
  178. */
  179. @property (nonatomic, strong, readonly) NSArray *occupants;
  180. /*!
  181. * \~chinese
  182. * 群组当前的成员数量,需要获取群详情, 包括owner, admins, members
  183. *
  184. * \~english
  185. * The total number of group occupants, include owner, admins, members
  186. */
  187. @property (nonatomic, readonly) NSInteger occupantsCount;
  188. /*!
  189. * \~chinese
  190. * 获取群组实例,如果不存在则创建
  191. *
  192. * @param aGroupId 群组ID
  193. *
  194. * @result 群组实例
  195. *
  196. * \~english
  197. * Get group instance, create a instance if it does not exist
  198. *
  199. * @param aGroupId Group id
  200. *
  201. * @result Group instance
  202. */
  203. + (instancetype)groupWithId:(NSString *)aGroupId;
  204. #pragma mark - EM_DEPRECATED_IOS 3.3.0
  205. /*!
  206. * \~chinese
  207. * 群组的成员列表,需要获取群详情
  208. *
  209. * \~english
  210. * Member list of the group
  211. */
  212. @property (nonatomic, copy, readonly) NSArray *members EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -memberList");
  213. /*!
  214. * \~chinese
  215. * 群组的黑名单,需要先调用获取群黑名单方法
  216. *
  217. * 需要owner权限才能查看,非owner返回nil
  218. *
  219. * \~english
  220. * Group‘s blacklist of blocked users
  221. *
  222. * Need owner's authority to access, return nil if user is not the group owner.
  223. */
  224. @property (nonatomic, strong, readonly) NSArray *blackList EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -blacklist");
  225. /*!
  226. * \~chinese
  227. * 群组当前的成员数量,需要获取群详情, 包括owner, admins, members
  228. *
  229. * \~english
  230. * The total number of group members, include owner, admins, members
  231. */
  232. @property (nonatomic, readonly) NSInteger membersCount EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -occupantsCount");
  233. /*!
  234. * \~chinese
  235. * 群组的主题,需要获取群详情
  236. *
  237. * \~english
  238. * Subject of the group
  239. */
  240. @property (nonatomic, copy, readonly) NSString *subject EM_DEPRECATED_IOS(3_1_0, 3_6_2, "Use -groupName");
  241. #pragma mark - EM_DEPRECATED_IOS < 3.2.3
  242. /*!
  243. * \~chinese
  244. * 初始化群组实例
  245. *
  246. * 请使用+groupWithId:方法
  247. *
  248. * @result nil
  249. *
  250. * \~english
  251. * Initialize a group instance
  252. *
  253. * Please use [+groupWithId:]
  254. *
  255. * @result nil
  256. */
  257. - (instancetype)init __deprecated_msg("Use +groupWithId:");
  258. /*!
  259. * \~chinese
  260. * 群组的黑名单,需要先调用获取群黑名单方法
  261. *
  262. * 需要owner权限才能查看,非owner返回nil
  263. *
  264. * \~english
  265. * Group‘s blacklist of blocked users
  266. *
  267. * Need owner's authority to access, return nil if user is not the group owner.
  268. */
  269. @property (nonatomic, strong, readonly) NSArray *bans __deprecated_msg("Use - blackList");
  270. @end