JMSGNotificationEvent.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * | | | | \ \ / / | | | | / _______|
  3. * | |____| | \ \/ / | |____| | / /
  4. * | |____| | \ / | |____| | | | _____
  5. * | | | | / \ | | | | | | |____ |
  6. * | | | | / /\ \ | | | | \ \______| |
  7. * | | | | /_/ \_\ | | | | \_________|
  8. *
  9. * Copyright (c) 2011 ~ 2015 Shenzhen HXHG. All rights reserved.
  10. */
  11. #import <Foundation/Foundation.h>
  12. #import <JMessage/JMSGConversation.h>
  13. /*!
  14. * 事件
  15. *
  16. * #### 事件分类
  17. *
  18. * 事件主要区分两类,通知事件、消息事件,两种不同类型的事件是通过不同的监听方法来监听的。
  19. *
  20. * #### 通知事件
  21. *
  22. * 通知事件就是除群事件之外的,如:当前登录登录状态变更、好友相关、消息撤回、消息透传、入群申请、管理员审批等事件.
  23. * 上层通过 JMSGEventDelegate 类里的相对应的代理方法接收事件,具体细分请查看 JMSGEventDelegate 类.
  24. *
  25. * #### 消息事件
  26. *
  27. * 消息事件就是群事件,如:群加人、踢人、修改群信息、群成员禁言、管理员变更等(即:会展示在消息列表的事件),SDK 依旧作为一个特殊的消息类型下发,上层通过 [JMSGMessageDelegate onReceiveMessage:] 接收消息事件.
  28. */
  29. @interface JMSGNotificationEvent : NSObject
  30. /*!
  31. * @abstract 事件类型
  32. * @discussion 参考事件类型的定义 JMSGEventNotificationType
  33. */
  34. @property(nonatomic, assign, readonly) JMSGEventNotificationType eventType;
  35. /*!
  36. * @abstract 事件的描述信息
  37. * @discussion 下发事件的文字描述,可能为空
  38. */
  39. @property(nonatomic, strong, readonly) NSString *eventDescription;
  40. @end
  41. /*!
  42. * @abstract 当前登录用户状态改变事件
  43. *
  44. * @discussion 当前登录用户被踢、非客户端修改密码强制登出、登录状态异常、被删除、被禁用、信息变更等通知
  45. *
  46. * @since 3.5.0
  47. */
  48. @interface JMSGUserLoginStatusChangeEvent: JMSGNotificationEvent
  49. @end
  50. /*!
  51. * @abstract 消息撤回事件
  52. *
  53. * @discussion 上层通过 JMSGEventDelegate 类中的 [JMSGEventDelegate onReceiveMessageRetractEvent:] 代理方法监听此事件,详见官方文档.
  54. */
  55. @interface JMSGMessageRetractEvent : JMSGNotificationEvent
  56. /// 消息撤回所属会话
  57. @property(nonatomic, strong, readonly) JMSGConversation *conversation;
  58. /// 撤回之后的消息
  59. @property(nonatomic, strong, readonly) JMSGMessage *retractMessage;
  60. @end
  61. /*!
  62. * @abstract 消息已读回执状态变更事件
  63. *
  64. * @discussion 上层通过 JMSGEventDelegate 类中的 [JMSGEventDelegate onReceiveMessageReceiptStatusChangeEvent:] 代理方法监听该事件
  65. */
  66. @interface JMSGMessageReceiptStatusChangeEvent : JMSGNotificationEvent
  67. /// 消息所属会话
  68. @property(nonatomic, strong, readonly) JMSGConversation *conversation;
  69. /// 已读回执变更的消息列表
  70. @property(nonatomic, strong, readonly) NSArray <__kindof JMSGMessage *>*messages;
  71. @end
  72. /*!
  73. * @abstract 消息透传事件
  74. *
  75. * @discussion 上层通过 JMSGEventDelegate 类中的 [JMSGEventDelegate onReceiveMessageTransparentEvent:] 代理方法监听该事件
  76. */
  77. @interface JMSGMessageTransparentEvent : JMSGNotificationEvent
  78. /// 消息透传的类型,单聊、群聊、设备间透传消息
  79. @property(nonatomic, assign, readonly) JMSGTransMessageType transMessageType;
  80. /// 透传消息的发送者
  81. @property(nonatomic, strong, readonly) JMSGUser *sendUser;
  82. /// 透传消息的目标对象,JMSGUser、JMSGGroup
  83. @property(nonatomic, strong, readonly) id target;
  84. /// 透传消息内容
  85. @property(nonatomic, strong, readonly) NSString *transparentText;
  86. /*!
  87. * @abstract 透传消息所属会话
  88. *
  89. * @discussion 注意:如果接收到设备间的透传事件,此属性的值为 nil;如果本地并没有创建会话,此属性也为 nil
  90. */
  91. @property(nonatomic, strong, readonly) JMSGConversation *conversation;
  92. @end
  93. /*!
  94. * @abstract 申请入群事件
  95. *
  96. * @discussion 上层通过 JMSGGroupDelegate 类中的 [JMSGGroupDelegate onReceiveApplyJoinGroupApprovalEvent:] 代理方法监听该事件
  97. */
  98. @interface JMSGApplyJoinGroupEvent : JMSGNotificationEvent
  99. /// 事件的 id
  100. @property(nonatomic, strong, readonly) NSString *eventID;
  101. /// 群 gid
  102. @property(nonatomic, strong, readonly) NSString *groupID;
  103. /// 是否是用户主动申请入群,YES:主动申请加入,NO:被邀请加入
  104. @property(nonatomic, assign, readonly) BOOL isInitiativeApply;
  105. /// 发起申请的 user
  106. @property(nonatomic, strong, readonly) JMSGUser *sendApplyUser;
  107. /// 被邀请入群的 user 数组
  108. @property(nonatomic, strong, readonly) NSArray JMSG_GENERIC(__kindof JMSGUser *)*joinGroupUsers;
  109. /// 原因
  110. @property(nonatomic, strong, readonly) NSString *reason;
  111. @end
  112. /*!
  113. * @abstract 管理员拒绝入群申请事件
  114. *
  115. * @discussion 上层通过 JMSGGroupDelegate 类中的 [JMSGGroupDelegate onReceiveGroupAdminRejectApplicationEvent:] 代理方法监听该事件
  116. */
  117. @interface JMSGGroupAdminRejectApplicationEvent : JMSGNotificationEvent
  118. /// 群 gid
  119. @property(nonatomic, strong, readonly) NSString *groupID;
  120. /// 拒绝原因
  121. @property(nonatomic, strong, readonly) NSString *rejectReason;
  122. /// 操作的管理员
  123. @property(nonatomic, strong, readonly) JMSGUser *groupManager;
  124. @end
  125. /*!
  126. * @abstract 管理员审批事件
  127. *
  128. * @discussion 管理员同意或者拒绝了某个入群申请,其他管理员会收到该通知,上层通过 JMSGGroupDelegate 类中的 [JMSGGroupDelegate onReceiveGroupAdminApprovalEvent:] 代理方法监听该事件
  129. */
  130. @interface JMSGGroupAdminApprovalEvent : JMSGNotificationEvent
  131. /// 管理员是否同意申请,YES:同意,NO:拒绝
  132. @property(nonatomic, assign, readonly) BOOL isAgreeApply;
  133. /// 申请入群事件的事件 id
  134. @property(nonatomic, strong, readonly) NSString *applyEventID;
  135. /// 群 gid
  136. @property(nonatomic, strong, readonly) NSString *groupID;
  137. /// 操作的管理员
  138. @property(nonatomic, strong, readonly) JMSGUser *groupAdmin;
  139. /// 申请或被邀请加入群的用户,即:实际入群的用户
  140. @property(nonatomic, strong, readonly) NSArray JMSG_GENERIC(__kindof JMSGUser *)*users;
  141. @end