EMMultiDevicesDelegate.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /**
  2. * \~chinese
  3. * @header EMMultiDevicesDelegate.h
  4. * @abstract 多设备代理协议
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMMultiDevicesDelegate.h
  10. * @abstract This protocol defined the callbacks of Multi-device
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMConversation.h"
  16. /**
  17. * \~chinese
  18. * 多设备登录事件类型。
  19. *
  20. * 本枚举类以用户 A 同时登录设备 A1 和 设备 A2 为例,描述多设备登录各事件的触发时机。
  21. *
  22. * \~english
  23. * Multi-device event types.
  24. *
  25. * This enumeration takes user A logged into both device A1 and device A2 as an example to illustrate the various multi-device event types and when these events are triggered.
  26. */
  27. typedef NS_ENUM(NSInteger, EMMultiDevicesEvent) {
  28. EMMultiDevicesEventUnknow = -1, /** \~chinese 默认。 \~english Default. */
  29. EMMultiDevicesEventContactRemove = 2, /** \~chinese 用户 A 在设备 A1 上删除了好友,则设备 A2 上会收到该事件。 \~english If user A deletes a contact on device A1, this event is triggered on device A2. */
  30. EMMultiDevicesEventContactAccept = 3, /** \~chinese 用户 A 在设备 A1 上同意了其他用户的好友请求,则设备 A2 上会收到该事件。 \~english If user A accepts a contact invitation on device A1, this event is triggered on device A2. */
  31. EMMultiDevicesEventContactDecline = 4, /** \~chinese 用户 A 在设备 A1 上拒绝了其他用户的好友请求,则设备 A2 上会收到该事件。 \~english If user A declines a contact invitation on device A1, this event is triggered on device A2. */
  32. EMMultiDevicesEventContactBan = 5, /** \~chinese 用户 A 在设备 A1 上将其他用户加入黑名单,则设备 A2 上会收到该事件。 \~english If user A adds another user into the block list on device A1, this event is triggered on device A2. */
  33. EMMultiDevicesEventContactAllow = 6, /** \~chinese 用户 A 在设备 A1 上将某用户移出黑名单,则设备 A2 上会收到该事件。 \~english If user A removes a user from the block list on device A1, this event is triggered on device A2. */
  34. EMMultiDevicesEventGroupCreate = 10, /** \~chinese 用户 A 在设备 A1 上创建了群组,则设备 A2 上会收到该事件。\~english If user A creates a chat group on Device A1, this event is triggered on device A2. */
  35. EMMultiDevicesEventGroupDestroy = 11, /** \~chinese 用户 A 在设备 A1 上销毁了群组,则设备 A2 上会收到该事件。 \~english If user A destroys a chat group on device A1, this event is triggered on device A2. */
  36. EMMultiDevicesEventGroupJoin = 12, /** \~chinese 用户 A 在设备 A1 上加入了群组,则设备 A2 会收到该事件。 \~english If user A joins a chat group on device A1, this event is triggered on device A2. */
  37. EMMultiDevicesEventGroupLeave = 13, /** \~chinese 用户 A 在设备 A1 上退出群组,则设备 A2 会收到该事件。 \~english If user A leaves a chat group on device A1, this event is triggered on device A2. */
  38. EMMultiDevicesEventGroupApply = 14, /** \~chinese 用户 A 在设备 A1 上申请加入群组,则设备 A2 会收到该事件。 \~english If user A requests to join a chat group on device A1, this event is triggered on device A2. */
  39. EMMultiDevicesEventGroupApplyAccept = 15, /** \~chinese 用户 A 在设备 A1 上收到了其他用户的入群申请,则设备 A2 会收到该事件。 \~english If user A receives another user's request to join the chat group on device A1, this event is triggered on device A2. */
  40. EMMultiDevicesEventGroupApplyDecline = 16, /** \~chinese 用户 A 在设备 A1 上拒绝了其他用户的入群申请,设备 A2 上会收到该事件。 \~english If user A declines another user's request to join the chat group on device A1, this event is triggered on device A2. */
  41. EMMultiDevicesEventGroupInvite = 17, /** \~chinese 用户 A 在设备 A1 上邀请了其他用户进入群组,则设备 A2 上会收到该事件。 \~english If user A invites other users to join the chat group on device A1, this event is triggered on device A2. */
  42. EMMultiDevicesEventGroupInviteAccept = 18, /** \~chinese 用户 A 在设备 A1 上同意了其他用户的群组邀请,则设备 A2 上会收到该事件。 \~english If user A accepts another user's group invitation on device A1, this event is triggered on device A2. */
  43. EMMultiDevicesEventGroupInviteDecline = 19, /** \~chinese 用户 A 在设备 A1 上拒绝了其他用户的群组邀请,则设备 A2 上会收到该事件。 \~english If user A declines another user's group invitation on device A1, this event is triggered on device A2. */
  44. EMMultiDevicesEventGroupKick = 20, /** \~chinese 用户 A 在设备 A1 上将其他用户踢出群组,则设备 A2 上会收到该事件。 \~english If user A removes other users from a chat group on device A1, this event is triggered on device A2. */
  45. EMMultiDevicesEventGroupBan = 21, /** \~chinese 用户 A 在设备 A1 上被加入黑名单,则设备 A2 上会收到该事件。 \~english If user A is added to the block list on device A1, this event is triggered on device A2. */
  46. EMMultiDevicesEventGroupAllow = 22, /** \~chinese 用户 A 在设备 A1 上将其他用户移出群组,则设备 A2 上会收到该事件。 \~english If user A removes other users from a chat group on device A1, this event is triggered on device A2. */
  47. EMMultiDevicesEventGroupBlock = 23, /** \~chinese 用户 A 在设备 A1 上屏蔽了某个群组的消息,设备 A2 上会收到该事件。 \~english If user A blocks messages from a chat group on device A1, this event is triggered on device A2. */
  48. EMMultiDevicesEventGroupUnBlock = 24, /** \~chinese 用户 A 在设备 A1 上取消屏蔽了某个群组的消息,设备 A2 上会收到该事件。 \~english If user A unblocks messages from a chat group on device A1, this event is triggered on device A2. */
  49. EMMultiDevicesEventGroupAssignOwner = 25, /** \~chinese 用户 A 在设备 A1 上更新了群组的群主,则设备 A2 上会收到该事件。 \~english If user A assigns a group owner on device A1, this event is triggered on device A2.*/
  50. EMMultiDevicesEventGroupAddAdmin = 26, /** \~chinese 用户 A 在设备 A1 上添加了群组管理员,则设备 A2 上会收到该事件。 \~english If user A adds a group admin on device A1, this event is triggered on device A2. */
  51. EMMultiDevicesEventGroupRemoveAdmin = 27, /** \~chinese 用户 A 在设备 A1 上移除了群组管理员,则设备 A2 上会收到该事件。 \~english If user A removes a group admin on device A1, this event is triggered on device A2. */
  52. EMMultiDevicesEventGroupAddMute = 28, /** \~chinese 用户 A 在设备 A1 上禁言了群成员,则设备 A2 上会收到该事件。 \~english If user A mutes other group members on device A1, this event is triggered on device A2. */
  53. EMMultiDevicesEventGroupRemoveMute = 29, /** \~chinese 用户 A 在设备 A1 上取消禁言了群成员,则设备 A2 上会收到该事件。 \~english If user A unmutes other group members in device A1, this event is triggered on device A2. */
  54. EMMultiDevicesEventGroupAddWhiteList = 30, /** \~chinese 用户 A 在设备 A1 上添加了群成员进白名单,则设备 A2 上会收到该事件。 \~english If user A adds a group member to the allow list in device A1, this event is triggered on device A2. */
  55. EMMultiDevicesEventGroupRemoveWhiteList = 31, /** \~chinese 用户 A 在设备 A1 上从白名单移除群成员,则设备 A2 上会收到该事件。 \~english If user A removes a group member from the allow list on device A1, this event is triggered on device A2. */
  56. EMMultiDevicesEventGroupAllBan = 32, /** \~chinese 用户 A 在设备 A1 上开启群组成员全体禁言,则设备 A2 上会收到该事件。 \~english If user A mutes all group members on device A1, this event is triggered on device A2. */
  57. EMMultiDevicesEventGroupRemoveAllBan = 33, /** \~chinese 用户 A 在设备 A1 上取消禁言了群成员,则设备 A2 上会收到该事件。 \~english If user A unmutes all group members in device A1, this event is triggered on device A2. */
  58. EMMultiDevicesEventGroupDisabled = 34, /** \~chinese 用户 A 所在群组被禁用,则用户 A 所有设备上会收到该事件。 \~english If the chat group that user A joins is disabled, this event is triggered on device A2. */
  59. EMMultiDevicesEventGroupAble = 35, /** \~chinese 用户 A 所在群组取消禁用,则用户 A 所有设备上会收到该事件。 \~english If the chat group that user A joins is enabled, this event is triggered on device A2. */
  60. EMMultiDevicesEventChatThreadCreate = 40, /** \~chinese 用户 A 在设备 A1 创建子区,则设备 A2 上会收到该事件。 \~english If user A creates a message thread on device A1, this event is triggered on device A2. */
  61. EMMultiDevicesEventChatThreadDestroy = 41,/** \~chinese 用户 A 在设备 A1 销毁了子区,则设备 A2 上会收到该事件。 \~english If user A destroys a message thread on device A1, this event is triggered on device A2. */
  62. EMMultiDevicesEventChatThreadJoin = 42,/** \~chinese 用户 A 在设备 A1 加入了子区,则设备 A2 上会收到该事件。 \~english If user A joins a message thread on device A1, this event is triggered on device A2.*/
  63. EMMultiDevicesEventChatThreadLeave = 43,/** \~chinese 用户 A 在设备 A1 离开了子区,则设备 A2 上会收到该事件。 \~english If user A leaves a message thread on device A1, this event is triggered on device A2. */
  64. EMMultiDevicesEventChatThreadUpdate = 44,/** \~chinese 用户 A 在设备 A1 更新子区,则设备 A2 上会收到该事件。 \~english If user A updates a message thread on device A1, this event is triggered on device A2. */
  65. EMMultiDevicesEventChatThreadKick = 45,/** \~chinese 用户 A 在设备 A1 被踢出子区,则设备 A2 上会收到该事件。 \~english If user A is kicked out of a message thread on device A1, this event is triggered on device A2. */
  66. EMMultiDevicesEventGroupMemberAttributesChanged = 46,/** \~chinese 用户 A 在设备 A1 上修改群成员自定义属性,则设备 A2 上会收到该事件。\~english If user A modifies a custom attribute of a group member on device A1, this event is triggered on device A2. */
  67. EMMultiDevicesEventConversationPinned = 60, /** \~chinese 用户 A 在设备 A1 置顶会话,则设备 A2 上会收到该事件。 \~english If user A pins a conversation on device A1, this event is triggered on device A2. */
  68. EMMultiDevicesEventConversationUnpinned = 61,/** \~chinese 用户 A 在设备 A1取消置顶会话,则设备 A2 上会收到该事件。 \~english If user A unpins a conversation on device A1, this event is triggered on device A2. */
  69. EMMultiDevicesEventConversationDelete = 62,/** \~chinese 用户 A 在设备 A1 删除会话,则设备 A2 上会收到该事件。 \~english If user A deletes a conversation on device A1, this event is triggered on device A2. */
  70. };
  71. @protocol EMMultiDevicesDelegate <NSObject>
  72. @optional
  73. /**
  74. * \~chinese
  75. * 多设备好友事件回调。
  76. *
  77. * @param aEvent 多设备事件类型。
  78. * @param aUsername 用户名。
  79. * @param aExt 扩展信息。
  80. *
  81. * \~english
  82. * The multi-device contact event callback.
  83. *
  84. * @param aEvent The event type.
  85. * @param aUsername The username.
  86. * @param aExt The extended Information.
  87. */
  88. - (void)multiDevicesContactEventDidReceive:(EMMultiDevicesEvent)aEvent
  89. username:(NSString * _Nonnull)aUsername
  90. ext:(NSString * _Nullable)aExt;
  91. /**
  92. * \~chinese
  93. * 多设备群组事件回调。
  94. *
  95. * @param aEvent 多设备事件类型。
  96. * @param aGroupId 群组 ID。
  97. * @param aExt 扩展信息。
  98. *
  99. * \~english
  100. * The multi-device group event callback.
  101. *
  102. * @param aEvent The event type.
  103. * @param aGroupId The group ID.
  104. * @param aExt The extended Information.
  105. */
  106. - (void)multiDevicesGroupEventDidReceive:(EMMultiDevicesEvent)aEvent
  107. groupId:(NSString * _Nonnull)aGroupId
  108. ext:(id _Nullable)aExt;
  109. /*!
  110. * \~chinese
  111. * 多设备子区事件回调。
  112. *
  113. * @param aEvent 多设备事件类型。
  114. * @param aThreadId 子区 ID。
  115. * @param aExt 扩展信息。
  116. *
  117. * \~english
  118. * The multi-device message thread event callback.
  119. *
  120. * @param aEvent The event type.
  121. * @param aThreadId The message thread ID.
  122. * @param aExt The extended Information.
  123. */
  124. - (void)multiDevicesChatThreadEventDidReceive:(EMMultiDevicesEvent)aEvent
  125. threadId:(NSString * _Nonnull)aThreadId
  126. ext:(id _Nullable)aExt;
  127. /*!
  128. * \~chinese
  129. * 单个会话设置免打扰的多设备事件回调。
  130. *
  131. * @param undisturbData 扩展信息。
  132. *
  133. * \~english
  134. * The multi-device event callback for setting the Do Not Disturb mode for a single conversation.
  135. *
  136. * @param aEvent The event type.
  137. * @param undisturbData The extended Information.
  138. */
  139. - (void)multiDevicesUndisturbEventNotifyFormOtherDeviceData:(NSString *_Nullable)undisturbData;
  140. /*!
  141. * \~chinese
  142. * 单个会话删除漫游消息的多设备事件回调。
  143. *
  144. * @param conversationId 会话 ID。
  145. * @param deviceId 设备 ID。
  146. *
  147. * \~english
  148. * The multi-device event callback for removing historical messages of a single conversation from the server.
  149. *
  150. * @param conversationId The conversation ID.
  151. * @param deviceId The device ID.
  152. */
  153. -(void)multiDevicesMessageBeRemoved:(NSString *_Nonnull)conversationId deviceId:(NSString *_Nonnull)deviceId;
  154. /*!
  155. * \~chinese
  156. * 单个会话操作的多设备事件回调。
  157. *
  158. * @param event 事件类型。
  159. * @param conversationId 会话 ID。
  160. * @param conversationType 会话类型。
  161. *
  162. * \~english
  163. * The multi-device event callback for the operation of a single conversation.
  164. *
  165. * @param event The event type.
  166. * @param conversationId The conversation ID.
  167. * @param conversationType The conversation type.
  168. */
  169. - (void)multiDevicesConversationEvent:(EMMultiDevicesEvent)event conversationId:(NSString *_Nonnull)conversationId conversationType:(EMConversationType)conversationType;
  170. @end