EMChatroomManagerDelegate.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /*!
  2. * \~chinese
  3. * @header EMChatroomManagerDelegate.h
  4. * @abstract 此协议定义了聊天室相关的回调
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMChatroomManagerDelegate.h
  10. * @abstract This protocol defined the callbacks of chatroom
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. /*!
  16. * \~chinese
  17. * 被踢出聊天室的原因
  18. *
  19. * \~english
  20. * The casuse for kicking a user out of a chatroom
  21. */
  22. typedef enum{
  23. EMChatroomBeKickedReasonBeRemoved = 0, /*! \~chinese 被管理员移出聊天室 \~english Removed by chatroom owner */
  24. EMChatroomBeKickedReasonDestroyed, /*! \~chinese 聊天室被销毁 \~english Chatroom has been destroyed */
  25. EMChatroomBeKickedReasonOffline, /*! \~chinese 当前账号离线 \~english Account offline */
  26. }EMChatroomBeKickedReason;
  27. @class EMChatroom;
  28. /*!
  29. * \~chinese
  30. * 聊天室相关的回调
  31. *
  32. * \~english
  33. * Callbacks of chatroom
  34. */
  35. @protocol EMChatroomManagerDelegate <NSObject>
  36. @optional
  37. /*!
  38. * \~chinese
  39. * 有用户加入聊天室
  40. *
  41. * @param aChatroom 加入的聊天室
  42. * @param aUsername 加入者
  43. *
  44. * \~english
  45. * Delegate method will be invoked when a user joins a chatroom.
  46. *
  47. * @param aChatroom Joined chatroom
  48. * @param aUsername The user who joined chatroom
  49. */
  50. - (void)userDidJoinChatroom:(EMChatroom *)aChatroom
  51. user:(NSString *)aUsername;
  52. /*!
  53. * \~chinese
  54. * 有用户离开聊天室
  55. *
  56. * @param aChatroom 离开的聊天室
  57. * @param aUsername 离开者
  58. *
  59. * \~english
  60. * Delegate method will be invoked when a user leaves a chatroom.
  61. *
  62. * @param aChatroom Left chatroom
  63. * @param aUsername The user who leaved chatroom
  64. */
  65. - (void)userDidLeaveChatroom:(EMChatroom *)aChatroom
  66. user:(NSString *)aUsername;
  67. /*!
  68. * \~chinese
  69. * 被踢出聊天室
  70. *
  71. * @param aChatroom 被踢出的聊天室
  72. * @param aReason 被踢出聊天室的原因
  73. *
  74. * \~english
  75. * Delegate method will be invoked when a user is dismissed from a chat room
  76. *
  77. * @param aChatroom aChatroom
  78. * @param aReason The reason of dismissing user from the chat room
  79. */
  80. - (void)didDismissFromChatroom:(EMChatroom *)aChatroom
  81. reason:(EMChatroomBeKickedReason)aReason;
  82. /*!
  83. * \~chinese
  84. * 有成员被加入禁言列表
  85. *
  86. * @param aChatroom 聊天室
  87. * @param aMutedMembers 被禁言的成员
  88. * @param aMuteExpire 禁言失效时间,暂时不可用
  89. *
  90. * \~english
  91. * Users are added to the mute list
  92. *
  93. * @param aChatroom Chatroom
  94. * @param aMutedMembers Users to be added
  95. * @param aMuteExpire Mute expire, not available at this time
  96. */
  97. - (void)chatroomMuteListDidUpdate:(EMChatroom *)aChatroom
  98. addedMutedMembers:(NSArray *)aMutes
  99. muteExpire:(NSInteger)aMuteExpire;
  100. /*!
  101. * \~chinese
  102. * 有成员被移出禁言列表
  103. *
  104. * @param aChatroom 聊天室
  105. * @param aMutedMembers 移出禁言列表的成员
  106. *
  107. * \~english
  108. * Users are removed from the mute list
  109. *
  110. * @param aChatroom Chatroom
  111. * @param aMutedMembers Users to be removed
  112. */
  113. - (void)chatroomMuteListDidUpdate:(EMChatroom *)aChatroom
  114. removedMutedMembers:(NSArray *)aMutes;
  115. /*!
  116. * \~chinese
  117. * 有成员被加入管理员列表
  118. *
  119. * @param aChatroom 聊天室
  120. * @param aAdmin 加入管理员列表的成员
  121. *
  122. * \~english
  123. * User is added to the admin list
  124. *
  125. * @param aChatroom Chatroom
  126. * @param aAdmin User to be added
  127. */
  128. - (void)chatroomAdminListDidUpdate:(EMChatroom *)aChatroom
  129. addedAdmin:(NSString *)aAdmin;
  130. /*!
  131. * \~chinese
  132. * 有成员被移出管理员列表
  133. *
  134. * @param aChatroom 聊天室
  135. * @param aAdmin 移出管理员列表的成员
  136. *
  137. * \~english
  138. * User is removed to the admin list
  139. *
  140. * @param aChatroom Chatroom
  141. * @param aAdmin User to be removed
  142. */
  143. - (void)chatroomAdminListDidUpdate:(EMChatroom *)aChatroom
  144. removedAdmin:(NSString *)aAdmin;
  145. /*!
  146. * \~chinese
  147. * 聊天室创建者有更新
  148. *
  149. * @param aChatroom 聊天室
  150. * @param aNewOwner 新群主
  151. * @param aOldOwner 旧群主
  152. *
  153. * \~english
  154. * Owner is updated
  155. *
  156. * @param aChatroom Chatroom
  157. * @param aNewOwner New Owner
  158. * @param aOldOwner Old Owner
  159. */
  160. - (void)chatroomOwnerDidUpdate:(EMChatroom *)aChatroom
  161. newOwner:(NSString *)aNewOwner
  162. oldOwner:(NSString *)aOldOwner;
  163. /*!
  164. * \~chinese
  165. * 聊天室公告有更新
  166. *
  167. * @param aChatroom 聊天室
  168. * @param aAnnouncement 公告
  169. *
  170. * \~english
  171. * Announcement is updated
  172. *
  173. * @param aChatroom Chatroom
  174. * @param aAnnouncement Announcement
  175. */
  176. - (void)chatroomAnnouncementDidUpdate:(EMChatroom *)aChatroom
  177. announcement:(NSString *)aAnnouncement;
  178. #pragma mark - Deprecated methods
  179. /*!
  180. * \~chinese
  181. * 有用户加入聊天室
  182. *
  183. * @param aChatroom 加入的聊天室
  184. * @param aUsername 加入者
  185. *
  186. * \~english
  187. * Delegate method will be invoked when a user joins a chat room
  188. *
  189. * @param aChatroom Joined chatroom
  190. * @param aUsername The user who joined chatroom
  191. */
  192. - (void)didReceiveUserJoinedChatroom:(EMChatroom *)aChatroom
  193. username:(NSString *)aUsername __deprecated_msg("Use -userDidJoinChatroom:user:");
  194. /*!
  195. * \~chinese
  196. * 有用户离开聊天室
  197. *
  198. * @param aChatroom 离开的聊天室
  199. * @param aUsername 离开者
  200. *
  201. * \~english
  202. * A user leaved chatroom
  203. *
  204. * @param aChatroom Leaved chatroom
  205. * @param aUsername The user who leaved chatroom
  206. */
  207. - (void)didReceiveUserLeavedChatroom:(EMChatroom *)aChatroom
  208. username:(NSString *)aUsername __deprecated_msg("Use -userDidLeaveChatroom:reason:");
  209. /*!
  210. * \~chinese
  211. * 被踢出聊天室
  212. *
  213. * @param aChatroom 被踢出的聊天室
  214. * @param aReason 被踢出聊天室的原因
  215. *
  216. * \~english
  217. * User was kicked out from a chatroom
  218. *
  219. * @param aChatroom The chatroom which user was kicked out from
  220. * @param aReason The reason of user was kicked out
  221. */
  222. - (void)didReceiveKickedFromChatroom:(EMChatroom *)aChatroom
  223. reason:(EMChatroomBeKickedReason)aReason __deprecated_msg("Use -didDismissFromChatroom:reason:");
  224. @end