EMChatroom.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. * 当前登录账号的聊天室成员类型
  124. *
  125. * \~english
  126. * The chatroom membership type of the current login account
  127. */
  128. @property (nonatomic, readonly) EMChatroomPermissionType permissionType;
  129. /*!
  130. * \~chinese
  131. * 聊天室的最大人数,如果没有获取聊天室详情将返回0
  132. *
  133. * \~english
  134. * The capacity of the chat room
  135. */
  136. @property (nonatomic, readonly) NSInteger maxOccupantsCount;
  137. /*!
  138. * \~chinese
  139. * 聊天室的当前人数,如果没有获取聊天室详情将返回0
  140. *
  141. * \~english
  142. * The total number of members in the chat room
  143. */
  144. @property (nonatomic, readonly) NSInteger occupantsCount;
  145. /*!
  146. * \~chinese
  147. * 获取聊天室实例
  148. *
  149. * @param aChatroomId 聊天室ID
  150. *
  151. * @result 聊天室实例
  152. *
  153. * \~english
  154. * Construct a chatroom instance with chatroom id
  155. *
  156. * @param aChatroomId Chatroom id
  157. *
  158. * @result Chatroom instance
  159. */
  160. + (instancetype)chatroomWithId:(NSString *)aChatroomId;
  161. #pragma mark - EM_DEPRECATED_IOS 3.3.0
  162. /*!
  163. * \~chinese
  164. * 聊天室的成员列表,需要获取聊天室详情
  165. *
  166. * \~english
  167. * List of members in the chat room
  168. */
  169. @property (nonatomic, copy, readonly) NSArray *members EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -memberList");
  170. /*!
  171. * \~chinese
  172. * 聊天室的当前人数,如果没有获取聊天室详情将返回0
  173. *
  174. * \~english
  175. * The total number of members in the chat room
  176. */
  177. @property (nonatomic, readonly) NSInteger membersCount EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -occupantsCount");
  178. /*!
  179. * \~chinese
  180. * 聊天室的最大人数,如果没有获取聊天室详情将返回0
  181. *
  182. * \~english
  183. * The capacity of the chat room
  184. */
  185. @property (nonatomic, readonly) NSInteger maxMembersCount EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -maxOccupantsCount");
  186. #pragma mark - EM_DEPRECATED_IOS < 3.2.3
  187. /*!
  188. * \~chinese
  189. * 聊天室的成员列表,需要获取聊天室详情
  190. *
  191. * \~english
  192. * List of members in the chat room
  193. */
  194. @property (nonatomic, copy, readonly) NSArray *occupants __deprecated_msg("Use - members");
  195. /*!
  196. * \~chinese
  197. * 初始化聊天室实例
  198. *
  199. * 请使用[+chatroomWithId:]方法
  200. *
  201. * @result nil
  202. *
  203. * \~english
  204. * Initialize chatroom instance
  205. *
  206. * Please use [+chatroomWithId:]
  207. *
  208. * @result nil
  209. */
  210. - (instancetype)init __deprecated_msg("Use +chatroomWithId:");
  211. @end