EMGroupManagerDelegate.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. /*!
  2. * \~chinese
  3. * @header EMGroupManagerDelegate.h
  4. * @abstract 此协议定义了群组相关的回调
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMGroupManagerDelegate.h
  10. * @abstract This protocol defined the callbacks of group
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. /*!
  16. * \~chinese
  17. * 离开群组的原因
  18. *
  19. * \~english
  20. * The reason of user leaving the group
  21. */
  22. typedef enum{
  23. EMGroupLeaveReasonBeRemoved = 0, /*! \~chinese 被移除 \~english Removed by owner */
  24. EMGroupLeaveReasonUserLeave, /*! \~chinese 自己主动离开 \~english User leave the group */
  25. EMGroupLeaveReasonDestroyed, /*! \~chinese 群组销毁 \~english Group has been destroyed */
  26. }EMGroupLeaveReason;
  27. @class EMGroup;
  28. @class EMGroupSharedFile;
  29. /*!
  30. * \~chinese
  31. * 群组相关的回调
  32. *
  33. * \~english
  34. * Delegate
  35. */
  36. @protocol EMGroupManagerDelegate <NSObject>
  37. @optional
  38. /*!
  39. * \~chinese
  40. * 用户A邀请用户B入群,用户B接收到该回调
  41. *
  42. * @param aGroupId 群组ID
  43. * @param aInviter 邀请者
  44. * @param aMessage 邀请信息
  45. *
  46. * \~english
  47. * Delegate method will be invoked when receiving a group invitation
  48. *
  49. * After user A invites user B into the group, user B will receive this callback
  50. *
  51. * @param aGroupId The group ID
  52. * @param aInviter Inviter
  53. * @param aMessage Invitation message
  54. */
  55. - (void)groupInvitationDidReceive:(NSString *)aGroupId
  56. inviter:(NSString *)aInviter
  57. message:(NSString *)aMessage;
  58. /*!
  59. * \~chinese
  60. * 用户B同意用户A的入群邀请后,用户A接收到该回调
  61. *
  62. * @param aGroup 群组实例
  63. * @param aInvitee 被邀请者
  64. *
  65. * \~english
  66. * Delegate method will be invoked when the group invitation is accepted
  67. *
  68. * After user B accepted user A‘s group invitation, user A will receive this callback
  69. *
  70. * @param aGroup User joined group
  71. * @param aInvitee Invitee
  72. */
  73. - (void)groupInvitationDidAccept:(EMGroup *)aGroup
  74. invitee:(NSString *)aInvitee;
  75. /*!
  76. * \~chinese
  77. * 用户B拒绝用户A的入群邀请后,用户A接收到该回调
  78. *
  79. * @param aGroup 群组
  80. * @param aInvitee 被邀请者
  81. * @param aReason 拒绝理由
  82. *
  83. * \~english
  84. * Delegate method will be invoked when the group invitation is declined.
  85. *
  86. * After user B declined user A's group invitation, user A will receive the callback
  87. *
  88. * @param aGroup Group instance
  89. * @param aInvitee Invitee
  90. * @param aReason Decline reason
  91. */
  92. - (void)groupInvitationDidDecline:(EMGroup *)aGroup
  93. invitee:(NSString *)aInvitee
  94. reason:(NSString *)aReason;
  95. /*!
  96. * \~chinese
  97. * SDK自动同意了用户A的加B入群邀请后,用户B接收到该回调,需要设置EMOptions的isAutoAcceptGroupInvitation为YES
  98. *
  99. * @param aGroup 群组实例
  100. * @param aInviter 邀请者
  101. * @param aMessage 邀请消息
  102. *
  103. * \~english
  104. * Delegate method will be invoked after SDK automatically accepted the group invitation
  105. *
  106. * User B will receive this callback after SDK automatically accept user A's group invitation, need set EMOptions's isAutoAcceptGroupInvitation property to YES
  107. *
  108. * @param aGroup Group instance
  109. * @param aInviter Inviter
  110. * @param aMessage Invite message
  111. */
  112. - (void)didJoinGroup:(EMGroup *)aGroup
  113. inviter:(NSString *)aInviter
  114. message:(NSString *)aMessage;
  115. /*!
  116. * \~chinese
  117. * 离开群组回调
  118. *
  119. * @param aGroup 群组实例
  120. * @param aReason 离开原因
  121. *
  122. * \~english
  123. * Delegate method will be invoked when user leaves a group
  124. *
  125. * @param aGroup Group instance
  126. * @param aReason Leave reason
  127. */
  128. - (void)didLeaveGroup:(EMGroup *)aGroup
  129. reason:(EMGroupLeaveReason)aReason;
  130. /*!
  131. * \~chinese
  132. * 群组的群主收到用户的入群申请,群的类型是EMGroupStylePublicJoinNeedApproval
  133. *
  134. * @param aGroup 群组实例
  135. * @param aApplicant 申请者
  136. * @param aReason 申请者的附属信息
  137. *
  138. * \~english
  139. * Delegate method will be invoked when the group owner receives a group request and group's style is EMGroupStylePublicJoinNeedApproval
  140. *
  141. * @param aGroup Group instance
  142. * @param aUsername The user initialized the group join request
  143. * @param aReason The user's message
  144. */
  145. - (void)joinGroupRequestDidReceive:(EMGroup *)aGroup
  146. user:(NSString *)aUsername
  147. reason:(NSString *)aReason;
  148. /*!
  149. * \~chinese
  150. * 群主拒绝用户A的入群申请后,用户A会接收到该回调,群的类型是EMGroupStylePublicJoinNeedApproval
  151. *
  152. * @param aGroupId 群组ID
  153. * @param aReason 拒绝理由
  154. *
  155. * \~english
  156. * Delegate method will be invoked when the group owner declines a join group request
  157. *
  158. * User A will receive this callback after group's owner declined the group request, group's style is EMGroupStylePublicJoinNeedApproval
  159. *
  160. * @param aGroupId Group id
  161. * @param aReason Decline reason
  162. */
  163. - (void)joinGroupRequestDidDecline:(NSString *)aGroupId
  164. reason:(NSString *)aReason;
  165. /*!
  166. * \~chinese
  167. * 群主同意用户A的入群申请后,用户A会接收到该回调,群的类型是EMGroupStylePublicJoinNeedApproval
  168. *
  169. * @param aGroup 通过申请的群组
  170. *
  171. * \~english
  172. * Delegate method will be invoked when the group owner approves a join group request
  173. *
  174. * User A will receive this callback after group's owner approve the group request, group's style is EMGroupStylePublicJoinNeedApproval
  175. *
  176. * @param aGroup Group instance
  177. */
  178. - (void)joinGroupRequestDidApprove:(EMGroup *)aGroup;
  179. /*!
  180. * \~chinese
  181. * 群组列表发生变化
  182. *
  183. * @param aGroupList 群组列表<EMGroup>
  184. *
  185. * \~english
  186. * Group List updated
  187. *
  188. * @param aGroupList Group list<EMGroup>
  189. */
  190. - (void)groupListDidUpdate:(NSArray *)aGroupList;
  191. /*!
  192. * \~chinese
  193. * 有成员被加入禁言列表
  194. *
  195. * @param aGroup 群组
  196. * @param aMutedMembers 被禁言的成员
  197. * @param aMuteExpire 禁言失效时间,当前不可用
  198. *
  199. * \~english
  200. * Users are added to the mute list
  201. *
  202. * @param aGroup Group
  203. * @param aMutedMembers Users to be added
  204. * @param aMuteExpire Mute expire, not available at this time
  205. */
  206. - (void)groupMuteListDidUpdate:(EMGroup *)aGroup
  207. addedMutedMembers:(NSArray *)aMutedMembers
  208. muteExpire:(NSInteger)aMuteExpire;
  209. /*!
  210. * \~chinese
  211. * 有成员被移出禁言列表
  212. *
  213. * @param aGroup 群组
  214. * @param aMutedMembers 移出禁言列表的成员
  215. *
  216. * \~english
  217. * Users are removed from the mute list
  218. *
  219. * @param aGroup Group
  220. * @param aMutedMembers Users to be removed
  221. */
  222. - (void)groupMuteListDidUpdate:(EMGroup *)aGroup
  223. removedMutedMembers:(NSArray *)aMutedMembers;
  224. /*!
  225. * \~chinese
  226. * 有成员被加入管理员列表
  227. *
  228. * @param aGroup 群组
  229. * @param aAdmin 加入管理员列表的成员
  230. *
  231. * \~english
  232. * User is added to the admin list
  233. *
  234. * @param aGroup Group
  235. * @param aAdmin User to be added
  236. */
  237. - (void)groupAdminListDidUpdate:(EMGroup *)aGroup
  238. addedAdmin:(NSString *)aAdmin;
  239. /*!
  240. * \~chinese
  241. * 有成员被移出管理员列表
  242. *
  243. * @param aGroup 群组
  244. * @param aAdmin 移出管理员列表的成员
  245. *
  246. * \~english
  247. * User is removed to the admin list
  248. *
  249. * @param aGroup Group
  250. * @param aAdmin User to be removed
  251. */
  252. - (void)groupAdminListDidUpdate:(EMGroup *)aGroup
  253. removedAdmin:(NSString *)aAdmin;
  254. /*!
  255. * \~chinese
  256. * 群组创建者有更新
  257. *
  258. * @param aGroup 群组
  259. * @param aNewOwner 新群主
  260. * @param aOldOwner 旧群主
  261. *
  262. * \~english
  263. * Owner is updated
  264. *
  265. * @param aGroup Group
  266. * @param aNewOwner New Owner
  267. * @param aOldOwner Old Owner
  268. */
  269. - (void)groupOwnerDidUpdate:(EMGroup *)aGroup
  270. newOwner:(NSString *)aNewOwner
  271. oldOwner:(NSString *)aOldOwner;
  272. /*!
  273. * \~chinese
  274. * 有用户加入群组
  275. *
  276. * @param aGroup 加入的群组
  277. * @param aUsername 加入者
  278. *
  279. * \~english
  280. * Delegate method will be invoked when a user joins a group.
  281. *
  282. * @param aGroup Joined group
  283. * @param aUsername The user who joined group
  284. */
  285. - (void)userDidJoinGroup:(EMGroup *)aGroup
  286. user:(NSString *)aUsername;
  287. /*!
  288. * \~chinese
  289. * 有用户离开群组
  290. *
  291. * @param aGroup 离开的群组
  292. * @param aUsername 离开者
  293. *
  294. * \~english
  295. * Delegate method will be invoked when a user leaves a group.
  296. *
  297. * @param aGroup Left group
  298. * @param aUsername The user who leaved group
  299. */
  300. - (void)userDidLeaveGroup:(EMGroup *)aGroup
  301. user:(NSString *)aUsername;
  302. /*!
  303. * \~chinese
  304. * 群公告有更新
  305. *
  306. * @param aGroup 群组
  307. * @param aAnnouncement 群公告
  308. *
  309. * \~english
  310. * Delegate method will be invoked when a user update the announcement from a group.
  311. *
  312. * @param aGroup Group
  313. * @param aAnnouncement Announcement
  314. */
  315. - (void)groupAnnouncementDidUpdate:(EMGroup *)aGroup
  316. announcement:(NSString *)aAnnouncement;
  317. /*!
  318. * \~chinese
  319. * 有用户上传群共享文件
  320. *
  321. * @param aGroup 群组
  322. * @param aSharedFile 共享文件
  323. *
  324. * \~english
  325. * Delegate method will be invoked when a user upload share file to a group.
  326. *
  327. * @param aGroup Group
  328. * @param aSharedFile Share File
  329. */
  330. - (void)groupFileListDidUpdate:(EMGroup *)aGroup
  331. addedSharedFile:(EMGroupSharedFile *)aSharedFile;
  332. /*!
  333. * \~chinese
  334. * 有用户删除群共享文件
  335. *
  336. * @param aGroup 群组
  337. * @param aFileId 共享文件ID
  338. *
  339. * \~english
  340. * Delegate method will be invoked when a user remove share file from a group.
  341. *
  342. * @param aGroup Group
  343. * @param aFileId File ID
  344. */
  345. - (void)groupFileListDidUpdate:(EMGroup *)aGroup
  346. removedSharedFile:(NSString *)aFileId;
  347. #pragma mark - Deprecated methods
  348. /*!
  349. * \~chinese
  350. * 用户A邀请用户B入群,用户B接收到该回调
  351. *
  352. * @param aGroupId 群组ID
  353. * @param aInviter 邀请者
  354. * @param aMessage 邀请信息
  355. *
  356. * \~english
  357. * Delegate method will be invoked when user receives a group invitation
  358. *
  359. * After user A invites user B into the group, user B will receive this callback
  360. *
  361. * @param aGroupId The group ID
  362. * @param aInviter Inviter
  363. * @param aMessage Invite message
  364. */
  365. - (void)didReceiveGroupInvitation:(NSString *)aGroupId
  366. inviter:(NSString *)aInviter
  367. message:(NSString *)aMessage __deprecated_msg("Use -groupInvitationDidReceive:inviter:message:");
  368. /*!
  369. * \~chinese
  370. * 用户B同意用户A的入群邀请后,用户A接收到该回调
  371. *
  372. * @param aGroup 群组实例
  373. * @param aInvitee 被邀请者
  374. *
  375. * \~english
  376. * Delegate method will be invoked when a group invitation is accepted
  377. *
  378. * After user B accepted user A‘s group invitation, user A will receive this callback
  379. *
  380. * @param aGroup Group to join
  381. * @param aInvitee Invitee
  382. */
  383. - (void)didReceiveAcceptedGroupInvitation:(EMGroup *)aGroup
  384. invitee:(NSString *)aInvitee __deprecated_msg("Use -groupInvitationDidAccept:invitee:");
  385. /*!
  386. * \~chinese
  387. * 用户B拒绝用户A的入群邀请后,用户A接收到该回调
  388. *
  389. * @param aGroup 群组
  390. * @param aInvitee 被邀请者
  391. * @param aReason 拒绝理由
  392. *
  393. * \~english
  394. * Delegate method will be invoked when a group invitation is declined
  395. *
  396. * After user B declined user A's group invitation, user A will receive the callback
  397. *
  398. * @param aGroup Group instance
  399. * @param aInvitee Invitee
  400. * @param aReason Decline reason
  401. */
  402. - (void)didReceiveDeclinedGroupInvitation:(EMGroup *)aGroup
  403. invitee:(NSString *)aInvitee
  404. reason:(NSString *)aReason __deprecated_msg("Use -groupInvitationDidDecline:invitee:reason:");
  405. /*!
  406. * \~chinese
  407. * SDK自动同意了用户A的加B入群邀请后,用户B接收到该回调,需要设置EMOptions的isAutoAcceptGroupInvitation为YES
  408. *
  409. * @param aGroup 群组实例
  410. * @param aInviter 邀请者
  411. * @param aMessage 邀请消息
  412. *
  413. * \~english
  414. * User B will receive this callback after SDK automatically accept user A's group invitation.
  415. * Set EMOptions's isAutoAcceptGroupInvitation property to YES for this delegate method
  416. *
  417. * @param aGroup Group instance
  418. * @param aInviter Inviter
  419. * @param aMessage Invite message
  420. */
  421. - (void)didJoinedGroup:(EMGroup *)aGroup
  422. inviter:(NSString *)aInviter
  423. message:(NSString *)aMessage __deprecated_msg("Use -didJoinGroup:inviter:message:");
  424. /*!
  425. * \~chinese
  426. * 离开群组回调
  427. *
  428. * @param aGroup 群组实例
  429. * @param aReason 离开原因
  430. *
  431. * \~english
  432. * Callback of leave group
  433. *
  434. * @param aGroup Group instance
  435. * @param aReason Leave reason
  436. */
  437. - (void)didReceiveLeavedGroup:(EMGroup *)aGroup
  438. reason:(EMGroupLeaveReason)aReason __deprecated_msg("Use -didLeaveGroup:reason:");
  439. /*!
  440. * \~chinese
  441. * 群组的群主收到用户的入群申请,群的类型是EMGroupStylePublicJoinNeedApproval
  442. *
  443. * @param aGroup 群组实例
  444. * @param aApplicant 申请者
  445. * @param aReason 申请者的附属信息
  446. *
  447. * \~english
  448. * Group's owner receive user's applicaton of joining group, group's style is EMGroupStylePublicJoinNeedApproval
  449. *
  450. * @param aGroup Group
  451. * @param aApplicant The applicant
  452. * @param aReason The applicant's message
  453. */
  454. - (void)didReceiveJoinGroupApplication:(EMGroup *)aGroup
  455. applicant:(NSString *)aApplicant
  456. reason:(NSString *)aReason __deprecated_msg("Use -joinGroupRequestDidReceive:user:reason:");
  457. /*!
  458. * \~chinese
  459. * 群主拒绝用户A的入群申请后,用户A会接收到该回调,群的类型是EMGroupStylePublicJoinNeedApproval
  460. *
  461. * @param aGroupId 群组ID
  462. * @param aReason 拒绝理由
  463. *
  464. * \~english
  465. * User A will receive this callback after group's owner declined the join group request
  466. *
  467. * @param aGroupId Group id
  468. * @param aReason Decline reason
  469. */
  470. - (void)didReceiveDeclinedJoinGroup:(NSString *)aGroupId
  471. reason:(NSString *)aReason __deprecated_msg("Use -joinGroupRequestDidDecline:reason:");
  472. /*!
  473. * \~chinese
  474. * 群主同意用户A的入群申请后,用户A会接收到该回调,群的类型是EMGroupStylePublicJoinNeedApproval
  475. *
  476. * @param aGroup 通过申请的群组
  477. *
  478. * \~english
  479. * User A will receive this callback after group's owner accepted it's application, group's style is EMGroupStylePublicJoinNeedApproval
  480. *
  481. * @param aGroup Group instance
  482. */
  483. - (void)didReceiveAcceptedJoinGroup:(EMGroup *)aGroup __deprecated_msg("Use -joinGroupRequestDidApprove:");
  484. /*!
  485. * \~chinese
  486. * 群组列表发生变化
  487. *
  488. * @param aGroupList 群组列表<EMGroup>
  489. *
  490. * \~english
  491. * Group List changed
  492. *
  493. * @param aGroupList Group list<EMGroup>
  494. */
  495. - (void)didUpdateGroupList:(NSArray *)aGroupList __deprecated_msg("Use -groupListDidUpdate:");
  496. @end