IRC client framework (wrapper around libircclient library).
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

IRCClientSessionDelegate.h 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. //
  2. // IRCClientSessionDelegate.h
  3. //
  4. // Modified IRCClient Copyright 2015-2021 Said Achmiz.
  5. // Original IRCClient Copyright 2009 Nathan Ollerenshaw.
  6. // libircclient Copyright 2004-2009 Georgy Yunaev.
  7. //
  8. // See LICENSE and README.md for more info.
  9. #import <Foundation/Foundation.h>
  10. @class IRCClientSession;
  11. @class IRCClientChannel;
  12. /** @brief Receives delegate messages from an IRCClientSession.
  13. *
  14. * Each IRCClientSession object needs a single delegate. Methods are called
  15. * for each event that occurs on an IRC server that the client is connected to.
  16. *
  17. * Note that for any given parameter, it may be optional, in which case a nil
  18. * object may be supplied instead of the given parameter.
  19. */
  20. @protocol IRCClientSessionDelegate <NSObject>
  21. /** The client has successfully connected to the IRC server. */
  22. @required
  23. -(void) connectionSucceeded:(IRCClientSession *)session;
  24. /** The client has disconnected from the IRC server. */
  25. @required
  26. -(void) disconnected:(IRCClientSession *)session;
  27. /** The client has received a PING message.
  28. *
  29. * (The contents of a PING could be anything. Sometimes it’s the server’s
  30. * hostname, sometimes other things...)
  31. *
  32. * @param pingData The contents of the PING message.
  33. * @param origin (optional) Where (who) the PING came from.
  34. */
  35. @optional
  36. -(void) ping:(NSData *)pingData
  37. from:(NSData *)origin
  38. session:(IRCClientSession *)session;
  39. /** An IRC client on a channel that this client is connected to has changed nickname,
  40. * or this IRC client has changed nicknames.
  41. *
  42. * @param nick The new nickname.
  43. * @param oldNick The old nickname.
  44. * @param wasItUs Did our nick change, or someone else’s?
  45. */
  46. @required
  47. -(void) nickChangedFrom:(NSData *)oldNick
  48. to:(NSData *)newNick
  49. own:(BOOL)wasItUs
  50. session:(IRCClientSession *)session;
  51. /** An IRC client on a channel that this client is connected to has quit IRC.
  52. *
  53. * @param nick The nickname of the client that quit.
  54. * @param reason (optional) The quit message, if any.
  55. */
  56. @required
  57. -(void) userQuit:(NSData *)nick
  58. withReason:(NSData *)reason
  59. session:(IRCClientSession *)session;
  60. /** The IRC client has joined (connected) successfully to a new channel. This
  61. * event creates an IRCClientChannel object, which you are expected to assign a
  62. * delegate to, to handle events from the channel.
  63. *
  64. * For example, on receipt of this message, a graphical IRC client would most
  65. * likely open a new window, create an IRCClientChannelDelegate for the window,
  66. * set the new IRCClientChannel’s delegate to the new delegate, and then hook
  67. * it up so that new events sent to the IRCClientChannelDelegate are sent to
  68. * the window.
  69. *
  70. * @param channel The IRCClientChannel object for the newly joined channel.
  71. */
  72. @required
  73. -(void) joinedNewChannel:(IRCClientChannel *)channel
  74. session:(IRCClientSession *)session;
  75. /** The client’s user mode has been changed.
  76. *
  77. * @param mode The new mode.
  78. * @param nick The person who changed the user mode (client itself, or it could
  79. * have been a channel operator, etc.).
  80. */
  81. @required
  82. -(void) modeSet:(NSData *)mode
  83. by:(NSData *)nick
  84. session:(IRCClientSession *)session;
  85. /** The client has received an ERROR message from the server.
  86. */
  87. @required
  88. -(void) errorReceived:(NSArray <NSData *> *)params
  89. session:(IRCClientSession *)session;
  90. /** The client has received a private PRIVMSG from another IRC client.
  91. *
  92. * @param message The text of the message.
  93. * @param nick The other IRC Client that sent the message.
  94. */
  95. @required
  96. -(void) privateMessageReceived:(NSData *)message
  97. fromUser:(NSData *)nick
  98. session:(IRCClientSession *)session;
  99. /** The client has received a private NOTICE from another client.
  100. *
  101. * @param notice The text of the message.
  102. * @param nick The nickname of the other IRC client that sent the message.
  103. */
  104. @required
  105. -(void) privateNoticeReceived:(NSData *)notice
  106. fromUser:(NSData *)nick
  107. session:(IRCClientSession *)session;
  108. /** The client has received a private PRIVMSG from the server.
  109. *
  110. * @param origin The sender of the message.
  111. * @param params The parameters of the message.
  112. */
  113. @required
  114. -(void) serverMessageReceivedFrom:(NSData *)origin
  115. params:(NSArray <NSData *> *)params
  116. session:(IRCClientSession *)session;
  117. /** The client has received a private NOTICE from the server.
  118. *
  119. * @param origin The sender of the notice.
  120. * @param params The parameters of the notice.
  121. */
  122. @required
  123. -(void) serverNoticeReceivedFrom:(NSData *)origin
  124. params:(NSArray <NSData *> *)params
  125. session:(IRCClientSession *)session;
  126. /** The IRC client has been invited to a channel.
  127. *
  128. * @param channelName The name of the channel for the invitation.
  129. * @param nick The nickname of the user that sent the invitation.
  130. */
  131. @required
  132. -(void) invitedToChannel:(NSData *)channelName
  133. by:(NSData *)nick
  134. session:(IRCClientSession *)session;
  135. /** A private CTCP request was sent to the IRC client.
  136. *
  137. * @param request The CTCP request string (after the type).
  138. * @param type The CTCP request type.
  139. * @param nick The nickname of the user that sent the request.
  140. */
  141. @optional
  142. -(void) CTCPRequestReceived:(NSData *)request
  143. ofType:(NSData *)type
  144. fromUser:(NSData *)nick
  145. session:(IRCClientSession *)session;
  146. /** A private CTCP reply was sent to the IRC client.
  147. *
  148. * @param reply An NSData containing the raw C string of the reply.
  149. * @param nick The nickname of the user that sent the reply.
  150. */
  151. @optional
  152. -(void) CTCPReplyReceived:(NSData *)reply
  153. fromUser:(NSData *)nick
  154. session:(IRCClientSession *)session;
  155. /** A private CTCP ACTION was sent to the IRC client.
  156. *
  157. * CTCP ACTION is not limited to channels; it may also be sent directly to other users.
  158. *
  159. * @param action The action message text.
  160. * @param nick The nickname of the client that sent the action.
  161. */
  162. @required
  163. -(void) privateCTCPActionReceived:(NSData *)action
  164. fromUser:(NSData *)nick
  165. session:(IRCClientSession *)session;
  166. /** An unhandled numeric was received from the IRC server
  167. *
  168. * @param event The unknown event number.
  169. * @param origin The sender of the event.
  170. * @param params An NSArray of NSData objects that are the raw C strings of the event.
  171. */
  172. @optional
  173. -(void) numericEventReceived:(NSUInteger)event
  174. from:(NSData *)origin
  175. params:(NSArray <NSData *> *)params
  176. session:(IRCClientSession *)session;
  177. /** An unhandled event was received from the IRC server.
  178. *
  179. * @param event The unknown event name.
  180. * @param origin The sender of the event.
  181. * @param params An NSArray of NSData objects that are the raw C strings of the event.
  182. */
  183. @optional
  184. -(void) unknownEventReceived:(NSData *)event
  185. from:(NSData *)origin
  186. params:(NSArray <NSData *> *)params
  187. session:(IRCClientSession *)session;
  188. @end