EMChatroom.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. /*!
  2. * \~chinese
  3. * @header EMChatroom.h
  4. * @abstract 聊天室
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMChatroom.h
  10. * @abstract Chatroom
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMCommonDefs.h"
  16. /*!
  17. * \~chinese
  18. * 聊天室成员类型
  19. *
  20. * \~english
  21. * Chat room permission type
  22. */
  23. typedef enum{
  24. EMChatroomPermissionTypeNone = -1, /*! \~chinese 未知 \~english Unknown */
  25. EMChatroomPermissionTypeMember = 0, /*! \~chinese 普通成员 \~english Normal member */
  26. EMChatroomPermissionTypeAdmin, /*! \~chinese 聊天室管理员 \~english Chatroom admin */
  27. EMChatroomPermissionTypeOwner, /*! \~chinese 聊天室拥有者 \~english Chatroom owner */
  28. }EMChatroomPermissionType;
  29. /*!
  30. * \~chinese
  31. * 聊天室
  32. *
  33. * \~english
  34. * Chat room object
  35. */
  36. @interface EMChatroom : NSObject
  37. /*!
  38. * \~chinese
  39. * 聊天室ID
  40. *
  41. * \~english
  42. * Chat room id
  43. */
  44. @property (nonatomic, copy, readonly) NSString *chatroomId;
  45. /*!
  46. * \~chinese
  47. * 聊天室的主题
  48. *
  49. * \~english
  50. * Subject of chat room
  51. */
  52. @property (nonatomic, copy, readonly) NSString *subject;
  53. /*!
  54. * \~chinese
  55. * 聊天室的描述
  56. *
  57. * \~english
  58. * Description of chat room
  59. */
  60. @property (nonatomic, copy, readonly) NSString *description;
  61. /*!
  62. * \~chinese
  63. * 聊天室的所有者,需要获取聊天室详情
  64. *
  65. * 聊天室的所有者只有一人
  66. *
  67. * \~english
  68. * Owner of the chat room. Only one owner per chat room.
  69. */
  70. @property (nonatomic, copy, readonly) NSString *owner;
  71. /*!
  72. * \~chinese
  73. * 聊天室的公告,需要获取聊天室公告
  74. *
  75. * \~english
  76. * Announcement of chat room
  77. */
  78. @property (nonatomic, copy, readonly) NSString *announcement;
  79. /*!
  80. * \~chinese
  81. * 聊天室的管理者,拥有聊天室的最高权限,需要获取聊天室详情
  82. *
  83. *
  84. * \~english
  85. * Admins of the chatroom
  86. *
  87. */
  88. @property (nonatomic, copy, readonly) NSArray *adminList;
  89. /*!
  90. * \~chinese
  91. * 聊天室的成员列表,需要通过分页获取聊天室成员列表接口加载
  92. *
  93. * \~english
  94. * List of members in the chat room
  95. */
  96. @property (nonatomic, copy, readonly) NSArray *memberList;
  97. /*!
  98. * \~chinese
  99. * 聊天室的黑名单,需要先调用获取聊天室黑名单方法
  100. *
  101. * 需要owner权限才能查看,非owner返回nil
  102. *
  103. * \~english
  104. * Chatroom‘s blacklist of blocked users
  105. *
  106. * Need owner's authority to access, return nil if user is not the chatroom owner.
  107. */
  108. @property (nonatomic, strong, readonly) NSArray *blacklist;
  109. /*!
  110. * \~chinese
  111. * 聊天室的被禁言列表<NSString>
  112. *
  113. * 需要owner权限才能查看,非owner返回nil
  114. *
  115. * \~english
  116. * List of muted members<NSString>
  117. *
  118. * Need owner's authority to access, return nil if user is not the chatroom owner.
  119. */
  120. @property (nonatomic, strong, readonly) NSArray *muteList;
  121. /*!
  122. * \~chinese
  123. * 聊天室的白名单列表<NSString>
  124. *
  125. * 需要owner权限才能查看,非owner返回nil
  126. *
  127. * \~english
  128. * List of whitelist members<NSString>
  129. *
  130. * Need owner's authority to access, return nil if user is not the chatroom owner.
  131. */
  132. @property (nonatomic, strong, readonly) NSArray *whiteList;
  133. /*!
  134. * \~chinese
  135. * 当前登录账号的聊天室成员类型
  136. *
  137. * \~english
  138. * The chatroom membership type of the current login account
  139. */
  140. @property (nonatomic, readonly) EMChatroomPermissionType permissionType;
  141. /*!
  142. * \~chinese
  143. * 聊天室的最大人数,如果没有获取聊天室详情将返回0
  144. *
  145. * \~english
  146. * The capacity of the chat room
  147. */
  148. @property (nonatomic, readonly) NSInteger maxOccupantsCount;
  149. /*!
  150. * \~chinese
  151. * 聊天室的当前人数,如果没有获取聊天室详情将返回0
  152. *
  153. * \~english
  154. * The total number of members in the chat room
  155. */
  156. @property (nonatomic, readonly) NSInteger occupantsCount;
  157. /**
  158. * \~chinese
  159. * 聊天室成员是否全部被静音
  160. *
  161. * \~english
  162. * The chat room is all members muted.
  163. */
  164. @property (nonatomic, readonly) BOOL isMuteAllMembers;
  165. /*!
  166. * \~chinese
  167. * 获取聊天室实例
  168. *
  169. * @param aChatroomId 聊天室ID
  170. *
  171. * @result 聊天室实例
  172. *
  173. * \~english
  174. * Construct a chatroom instance with chatroom id
  175. *
  176. * @param aChatroomId Chatroom id
  177. *
  178. * @result Chatroom instance
  179. */
  180. + (instancetype)chatroomWithId:(NSString *)aChatroomId;
  181. #pragma mark - EM_DEPRECATED_IOS 3.3.0
  182. /*!
  183. * \~chinese
  184. * 聊天室的成员列表,需要获取聊天室详情
  185. *
  186. * \~english
  187. * List of members in the chat room
  188. */
  189. @property (nonatomic, copy, readonly) NSArray *members EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -memberList");
  190. /*!
  191. * \~chinese
  192. * 聊天室的当前人数,如果没有获取聊天室详情将返回0
  193. *
  194. * \~english
  195. * The total number of members in the chat room
  196. */
  197. @property (nonatomic, readonly) NSInteger membersCount EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -occupantsCount");
  198. /*!
  199. * \~chinese
  200. * 聊天室的最大人数,如果没有获取聊天室详情将返回0
  201. *
  202. * \~english
  203. * The capacity of the chat room
  204. */
  205. @property (nonatomic, readonly) NSInteger maxMembersCount EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -maxOccupantsCount");
  206. #pragma mark - EM_DEPRECATED_IOS < 3.2.3
  207. /*!
  208. * \~chinese
  209. * 聊天室的成员列表,需要获取聊天室详情
  210. *
  211. * \~english
  212. * List of members in the chat room
  213. */
  214. @property (nonatomic, copy, readonly) NSArray *occupants __deprecated_msg("Use - members");
  215. /*!
  216. * \~chinese
  217. * 初始化聊天室实例
  218. *
  219. * 请使用[+chatroomWithId:]方法
  220. *
  221. * @result nil
  222. *
  223. * \~english
  224. * Initialize chatroom instance
  225. *
  226. * Please use [+chatroomWithId:]
  227. *
  228. * @result nil
  229. */
  230. - (instancetype)init __deprecated_msg("Use +chatroomWithId:");
  231. @end