ircinch 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/.standard.yml +3 -0
  3. data/CHANGELOG.md +298 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +5 -0
  6. data/LICENSE.txt +23 -0
  7. data/README.md +195 -0
  8. data/Rakefile +14 -0
  9. data/docs/bot_options.md +454 -0
  10. data/docs/changes.md +541 -0
  11. data/docs/common_mistakes.md +60 -0
  12. data/docs/common_tasks.md +57 -0
  13. data/docs/encodings.md +69 -0
  14. data/docs/events.md +273 -0
  15. data/docs/getting_started.md +184 -0
  16. data/docs/logging.md +90 -0
  17. data/docs/migrating.md +267 -0
  18. data/docs/plugins.md +4 -0
  19. data/docs/readme.md +20 -0
  20. data/examples/basic/autovoice.rb +32 -0
  21. data/examples/basic/google.rb +35 -0
  22. data/examples/basic/hello.rb +14 -0
  23. data/examples/basic/join_part.rb +35 -0
  24. data/examples/basic/memo.rb +39 -0
  25. data/examples/basic/msg.rb +15 -0
  26. data/examples/basic/seen.rb +37 -0
  27. data/examples/basic/urban_dict.rb +36 -0
  28. data/examples/basic/url_shorten.rb +36 -0
  29. data/examples/plugins/autovoice.rb +37 -0
  30. data/examples/plugins/custom_prefix.rb +22 -0
  31. data/examples/plugins/dice_roll.rb +38 -0
  32. data/examples/plugins/google.rb +36 -0
  33. data/examples/plugins/hello.rb +21 -0
  34. data/examples/plugins/hooks.rb +34 -0
  35. data/examples/plugins/join_part.rb +41 -0
  36. data/examples/plugins/lambdas.rb +35 -0
  37. data/examples/plugins/last_nick.rb +24 -0
  38. data/examples/plugins/msg.rb +21 -0
  39. data/examples/plugins/multiple_matches.rb +32 -0
  40. data/examples/plugins/own_events.rb +37 -0
  41. data/examples/plugins/seen.rb +44 -0
  42. data/examples/plugins/timer.rb +22 -0
  43. data/examples/plugins/url_shorten.rb +34 -0
  44. data/ircinch.gemspec +43 -0
  45. data/lib/cinch/ban.rb +53 -0
  46. data/lib/cinch/bot.rb +476 -0
  47. data/lib/cinch/cached_list.rb +21 -0
  48. data/lib/cinch/callback.rb +22 -0
  49. data/lib/cinch/channel.rb +465 -0
  50. data/lib/cinch/channel_list.rb +31 -0
  51. data/lib/cinch/configuration/bot.rb +50 -0
  52. data/lib/cinch/configuration/dcc.rb +18 -0
  53. data/lib/cinch/configuration/plugins.rb +43 -0
  54. data/lib/cinch/configuration/sasl.rb +21 -0
  55. data/lib/cinch/configuration/ssl.rb +21 -0
  56. data/lib/cinch/configuration/timeouts.rb +16 -0
  57. data/lib/cinch/configuration.rb +75 -0
  58. data/lib/cinch/constants.rb +535 -0
  59. data/lib/cinch/dcc/dccable_object.rb +39 -0
  60. data/lib/cinch/dcc/incoming/send.rb +149 -0
  61. data/lib/cinch/dcc/incoming.rb +3 -0
  62. data/lib/cinch/dcc/outgoing/send.rb +123 -0
  63. data/lib/cinch/dcc/outgoing.rb +3 -0
  64. data/lib/cinch/dcc.rb +14 -0
  65. data/lib/cinch/exceptions.rb +48 -0
  66. data/lib/cinch/formatting.rb +127 -0
  67. data/lib/cinch/handler.rb +120 -0
  68. data/lib/cinch/handler_list.rb +92 -0
  69. data/lib/cinch/helpers.rb +230 -0
  70. data/lib/cinch/i_support.rb +100 -0
  71. data/lib/cinch/irc.rb +924 -0
  72. data/lib/cinch/log_filter.rb +23 -0
  73. data/lib/cinch/logger/formatted_logger.rb +100 -0
  74. data/lib/cinch/logger/zcbot_logger.rb +26 -0
  75. data/lib/cinch/logger.rb +171 -0
  76. data/lib/cinch/logger_list.rb +88 -0
  77. data/lib/cinch/mask.rb +69 -0
  78. data/lib/cinch/message.rb +397 -0
  79. data/lib/cinch/message_queue.rb +104 -0
  80. data/lib/cinch/mode_parser.rb +78 -0
  81. data/lib/cinch/network.rb +106 -0
  82. data/lib/cinch/open_ended_queue.rb +26 -0
  83. data/lib/cinch/pattern.rb +66 -0
  84. data/lib/cinch/plugin.rb +517 -0
  85. data/lib/cinch/plugin_list.rb +40 -0
  86. data/lib/cinch/rubyext/float.rb +5 -0
  87. data/lib/cinch/rubyext/module.rb +28 -0
  88. data/lib/cinch/rubyext/string.rb +35 -0
  89. data/lib/cinch/sasl/dh_blowfish.rb +73 -0
  90. data/lib/cinch/sasl/diffie_hellman.rb +50 -0
  91. data/lib/cinch/sasl/mechanism.rb +8 -0
  92. data/lib/cinch/sasl/plain.rb +29 -0
  93. data/lib/cinch/sasl.rb +36 -0
  94. data/lib/cinch/syncable.rb +83 -0
  95. data/lib/cinch/target.rb +199 -0
  96. data/lib/cinch/timer.rb +147 -0
  97. data/lib/cinch/user.rb +489 -0
  98. data/lib/cinch/user_list.rb +89 -0
  99. data/lib/cinch/utilities/deprecation.rb +18 -0
  100. data/lib/cinch/utilities/encoding.rb +39 -0
  101. data/lib/cinch/utilities/kernel.rb +15 -0
  102. data/lib/cinch/version.rb +6 -0
  103. data/lib/cinch.rb +7 -0
  104. data/lib/ircinch.rb +7 -0
  105. metadata +205 -0
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cinch
4
+ # @since 2.0.0
5
+ class Configuration < OpenStruct
6
+ KNOWN_OPTIONS = []
7
+
8
+ # Generate a default configuration.
9
+ #
10
+ # @return [Hash]
11
+ def self.default_config
12
+ {}
13
+ end
14
+
15
+ def initialize(base = nil)
16
+ base ||= self.class.default_config
17
+ super(base)
18
+ end
19
+
20
+ # @return [Hash]
21
+ def to_h
22
+ @table.clone
23
+ end
24
+
25
+ def [](key)
26
+ # FIXME also adjust method_missing
27
+ raise ArgumentError, "Unknown option #{key}" unless self.class::KNOWN_OPTIONS.include?(key)
28
+ @table[key]
29
+ end
30
+
31
+ def []=(key, value)
32
+ # FIXME also adjust method_missing
33
+ raise ArgumentError, "Unknown option #{key}" unless self.class::KNOWN_OPTIONS.include?(key)
34
+ modifiable[new_ostruct_member(key)] = value
35
+ end
36
+
37
+ # Loads a configuration from a hash by merging the hash with
38
+ # either the current configuration or the default configuration.
39
+ #
40
+ # @param [Hash] new_config The configuration to load
41
+ # @param [Boolean] from_default If true, the configuration won't
42
+ # be merged with the currently set up configuration (by prior
43
+ # calls to {#load} or {Bot#configure}) but with the default
44
+ # configuration.
45
+ # @return [void]
46
+ def load(new_config, from_default = false)
47
+ if from_default
48
+ @table = self.class.default_config
49
+ end
50
+
51
+ new_config.each do |option, value|
52
+ if value.is_a?(Hash)
53
+ if self[option].is_a?(Configuration)
54
+ self[option].load(value)
55
+ else
56
+ # recursive merging is handled by subclasses like
57
+ # Configuration::Plugins
58
+ self[option] = value
59
+ end
60
+ else
61
+ self[option] = value
62
+ end
63
+ end
64
+ end
65
+
66
+ # Like {#load} but always uses the default configuration
67
+ #
68
+ # @param [Hash] new_config (see #load_config)
69
+ # @return [void]
70
+ # @see #load
71
+ def load!(new_config)
72
+ load(new_config, true)
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,535 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cinch
4
+ # All standard and some non-standard numeric replies used by the IRC
5
+ # protocol.
6
+ module Constants
7
+ # Used to indicate the nickname parameter supplied to a command is
8
+ # currently unused.
9
+ ERR_NOSUCHNICK = 401
10
+
11
+ # Used to indicate the server name given currently doesn't exist.
12
+ ERR_NOSUCHSERVER = 402
13
+
14
+ # Used to indicate the given channel name is invalid.
15
+ ERR_NOSUCHCHANNEL = 403
16
+
17
+ # Sent to a user who is either
18
+ # - not on a channel which is mode +n
19
+ # - not a chanop (or mode +v) on a channel which has mode +m set
20
+ # and is trying to send a PRIVMSG message to that channel.
21
+ ERR_CANNOTSENDTOCHAN = 404
22
+
23
+ # Sent to a user when they have joined the maximum number of allowed
24
+ # channels and they try to join another channel.
25
+ ERR_TOOMANYCHANNELS = 405
26
+
27
+ # Returned by WHOWAS to indicate there is no history information for
28
+ # that nickname.
29
+ ERR_WASNOSUCHNICK = 406
30
+
31
+ # Returned to a client which is attempting to send PRIVMSG/NOTICE
32
+ # using the user@host destination format and for a user@host which has
33
+ # several occurrences.
34
+ ERR_TOOMANYTARGETS = 407
35
+
36
+ # PING or PONG message missing the originator parameter which is
37
+ # required since these commands must work without valid prefixes.
38
+ ERR_NOORIGIN = 409
39
+
40
+ # @todo Document this constant
41
+ ERR_NORECIPIENT = 411
42
+
43
+ # @todo Document this constant
44
+ ERR_NOTEXTTOSEND = 412
45
+
46
+ # @todo Document this constant
47
+ ERR_NOTOPLEVEL = 413
48
+
49
+ # 412 - 414 are returned by PRIVMSG to indicate that the message
50
+ # wasn't delivered for some reason. ERR_NOTOPLEVEL and
51
+ # ERR_WILDTOPLEVEL are errors that are returned when an invalid use of
52
+ # "PRIVMSG $&lt;server&gt;" or "PRIVMSG #&lt;host&gt;" is attempted.
53
+ ERR_WILDTOPLEVEL = 414
54
+
55
+ # Returned to a registered client to indicate that the command sent is
56
+ # unknown by the server.
57
+ ERR_UNKNOWNCOMMAND = 421
58
+
59
+ # Server's MOTD file could not be opened by the server.
60
+ ERR_NOMOTD = 422
61
+
62
+ # Returned by a server in response to an ADMIN message when there is
63
+ # an error in finding the appropriate information.
64
+ ERR_NOADMININFO = 423
65
+
66
+ # Generic error message used to report a failed file operation during
67
+ # the processing of a message.
68
+ ERR_FILEERROR = 424
69
+
70
+ # Returned when a nickname parameter expected for a command and isn't
71
+ # found.
72
+ ERR_NONICKNAMEGIVEN = 431
73
+
74
+ # Returned after receiving a NICK message which contains characters
75
+ # which do not fall in the defined set.
76
+ ERR_ERRONEUSNICKNAME = 432
77
+
78
+ # Returned when a NICK message is processed that results in an attempt
79
+ # to change to a currently existing nickname.
80
+ ERR_NICKNAMEINUSE = 433
81
+
82
+ # Returned by a server to a client when it detects a nickname
83
+ # collision (registered of a NICK that already exists by another
84
+ # server).
85
+ ERR_NICKCOLLISION = 436
86
+
87
+ # Returned by the server to indicate that the target user of the
88
+ # command is not on the given channel.
89
+ ERR_USERNOTINCHANNEL = 441
90
+
91
+ # Returned by the server whenever a client tries to perform a channel
92
+ # effecting command for which the client isn't a member.
93
+ ERR_NOTONCHANNEL = 442
94
+
95
+ # Returned when a client tries to invite a user to a channel they are
96
+ # already on.
97
+ ERR_USERONCHANNEL = 443
98
+
99
+ # Returned by the summon after a SUMMON command for a user was unable
100
+ # to be performed since they were not logged in.
101
+ ERR_NOLOGIN = 444
102
+
103
+ # Returned as a response to the SUMMON command. Must be returned by
104
+ # any server which does not implement it.
105
+ ERR_SUMMONDISABLED = 445
106
+
107
+ # Returned as a response to the USERS command. Must be returned by any
108
+ # server which does not implement it.
109
+ ERR_USERSDISABLED = 446
110
+
111
+ # Returned by the server to indicate that the client must be
112
+ # registered before the server will allow it to be parsed in detail.
113
+ ERR_NOTREGISTERED = 451
114
+
115
+ # Returned by the server by numerous commands to indicate to the
116
+ # client that it didn't supply enough parameters.
117
+ ERR_NEEDMOREPARAMS = 461
118
+
119
+ # Returned by the server to any link which tries to change part of the
120
+ # registered details (such as password or user details from second
121
+ # USER message).
122
+ ERR_ALREADYREGISTRED = 462
123
+
124
+ # Returned to a client which attempts to register with a server which
125
+ # does not been setup to allow connections from the host the attempted
126
+ # connection is tried.
127
+ ERR_NOPERMFORHOST = 463
128
+
129
+ # Returned to indicate a failed attempt at registering a connection
130
+ # for which a password was required and was either not given or
131
+ # incorrect.
132
+ ERR_PASSWDMISMATCH = 464
133
+
134
+ # Returned after an attempt to connect and register yourself with a
135
+ # server which has been setup to explicitly deny connections to you.
136
+ ERR_YOUREBANNEDCREEP = 465
137
+
138
+ # @todo Document this constant
139
+ ERR_KEYSET = 467
140
+
141
+ # @todo Document this constant
142
+ ERR_CHANNELISFULL = 471
143
+
144
+ # @todo Document this constant
145
+ ERR_UNKNOWNMODE = 472
146
+
147
+ # @todo Document this constant
148
+ ERR_INVITEONLYCHAN = 473
149
+
150
+ # @todo Document this constant
151
+ ERR_BANNEDFROMCHAN = 474
152
+
153
+ # @todo Document this constant
154
+ ERR_BADCHANNELKEY = 475
155
+
156
+ # Any command requiring operator privileges to operate must return
157
+ # this error to indicate the attempt was unsuccessful.
158
+ ERR_NOPRIVILEGES = 481
159
+
160
+ # Any command requiring 'chanop' privileges (such as MODE messages)
161
+ # must return this error if the client making the attempt is not a
162
+ # chanop on the specified channel.
163
+ ERR_CHANOPRIVSNEEDED = 482
164
+
165
+ # Any attempts to use the KILL command on a server are to be refused
166
+ # and this error returned directly to the client.
167
+ ERR_CANTKILLSERVER = 483
168
+
169
+ # If a client sends an OPER message and the server has not been
170
+ # configured to allow connections from the client's host as an
171
+ # operator, this error must be returned.
172
+ ERR_NOOPERHOST = 491
173
+
174
+ # Returned by the server to indicate that a MODE message was sent with
175
+ # a nickname parameter and that the a mode flag sent was not
176
+ # recognized.
177
+ ERR_UMODEUNKNOWNFLAG = 501
178
+
179
+ # Error sent to any user trying to view or change the user mode for a
180
+ # user other than themselves.
181
+ ERR_USERSDONTMATCH = 502
182
+
183
+ # @todo Document this constant
184
+ RPL_NONE = 300
185
+
186
+ # Reply format used by USERHOST to list replies to the query list.
187
+ RPL_USERHOST = 302
188
+
189
+ # Reply format used by ISON to list replies to the query list.
190
+ RPL_ISON = 303
191
+
192
+ # RPL_AWAY is sent to any client sending a PRIVMSG to a client which
193
+ # is away. RPL_AWAY is only sent by the server to which the client is
194
+ # connected.
195
+ RPL_AWAY = 301
196
+
197
+ # Replies RPL_UNAWAY and RPL_NOWAWAY are sent when the client removes
198
+ # and sets an AWAY message
199
+ RPL_UNAWAY = 305
200
+
201
+ # Replies RPL_UNAWAY and RPL_NOWAWAY are sent when the client removes
202
+ # and sets an AWAY message
203
+ RPL_NOWAWAY = 306
204
+
205
+ # @todo Document this constant
206
+ RPL_WHOISUSER = 311
207
+
208
+ # @todo Document this constant
209
+ RPL_WHOISSERVER = 312
210
+
211
+ # @todo Document this constant
212
+ RPL_WHOISOPERATOR = 313
213
+
214
+ # @todo Document this constant
215
+ RPL_WHOISIDLE = 317
216
+
217
+ # @todo Document this constant
218
+ RPL_ENDOFWHOIS = 318
219
+
220
+ # Replies 311 - 313, 317 - 319 are all replies generated in response
221
+ # to a WHOIS message. Given that there are enough parameters present,
222
+ # the answering server must either formulate a reply out of the above
223
+ # numerics (if the query nick is found) or return an error reply. The
224
+ # '*' in RPL_WHOISUSER is there as the literal character and not as a
225
+ # wild card. For each reply set, only RPL_WHOISCHANNELS may appear
226
+ # more than once (for long lists of channel names). The '@' and '+'
227
+ # characters next to the channel name indicate whether a client is a
228
+ # channel operator or has been granted permission to speak on a
229
+ # moderated channel. The RPL_ENDOFWHOIS reply is used to mark the end
230
+ # of processing a WHOIS message.
231
+ RPL_WHOISCHANNELS = 319
232
+
233
+ # @todo Document this constant
234
+ RPL_WHOWASUSER = 314
235
+
236
+ # When replying to a WHOWAS message, a server must use the replies
237
+ # RPL_WHOWASUSER, RPL_WHOISSERVER or ERR_WASNOSUCHNICK for each
238
+ # nickname in the presented list. At the end of all reply batches,
239
+ # there must be RPL_ENDOFWHOWAS (even if there was only one reply and
240
+ # it was an error).
241
+ RPL_ENDOFWHOWAS = 369
242
+
243
+ # @todo Document this constant
244
+ RPL_LISTSTART = 321
245
+
246
+ # @todo Document this constant
247
+ RPL_LIST = 322
248
+
249
+ # Replies RPL_LISTSTART, RPL_LIST, RPL_LISTEND mark the start, actual
250
+ # replies with data and end of the server's response to a LIST
251
+ # command. If there are no channels available to return, only the
252
+ # start and end reply must be sent.
253
+ RPL_LISTEND = 323
254
+
255
+ # @todo Document this constant
256
+ RPL_CHANNELMODEIS = 324
257
+
258
+ # @todo Document this constant
259
+ RPL_NOTOPIC = 331
260
+
261
+ # When sending a TOPIC message to determine the channel topic, one of
262
+ # two replies is sent. If the topic is set, RPL_TOPIC is sent back
263
+ # else RPL_NOTOPIC.
264
+ RPL_TOPIC = 332
265
+
266
+ # Returned by the server to indicate that the attempted INVITE message
267
+ # was successful and is being passed onto the end client.
268
+ RPL_INVITING = 341
269
+
270
+ # Returned by a server answering a SUMMON message to indicate that it
271
+ # is summoning that user.
272
+ RPL_SUMMONING = 342
273
+
274
+ # Reply by the server showing its version details. The &lt;version&gt;
275
+ # is the version of the software being used (including any patchlevel
276
+ # revisions) and the &lt;debuglevel&gt; is used to indicate if the
277
+ # server is running in "debug mode".
278
+ #
279
+ # The "comments" field may contain any comments about the version or
280
+ # further version details.
281
+ RPL_VERSION = 351
282
+
283
+ # @todo Document this constant
284
+ RPL_WHOREPLY = 352
285
+
286
+ # The RPL_WHOREPLY and RPL_ENDOFWHO pair are used to answer a WHO
287
+ # message. The RPL_WHOREPLY is only sent if there is an appropriate
288
+ # match to the WHO query. If there is a list of parameters supplied
289
+ # with a WHO message, a RPL_ENDOFWHO must be sent after processing
290
+ # each list item with &lt;name&gt; being the item.
291
+ RPL_ENDOFWHO = 315
292
+
293
+ # @todo Document this constant
294
+ RPL_NAMREPLY = 353
295
+
296
+ # @todo Document this constant
297
+ RPL_NAMEREPLY = RPL_NAMREPLY
298
+
299
+ # @todo Document this constant
300
+ RPL_WHOSPCRPL = 354
301
+
302
+ # To reply to a NAMES message, a reply pair consisting of RPL_NAMREPLY
303
+ # and RPL_ENDOFNAMES is sent by the server back to the client. If
304
+ # there is no channel found as in the query, then only RPL_ENDOFNAMES
305
+ # is returned. The exception to this is when a NAMES message is sent
306
+ # with no parameters and all visible channels and contents are sent
307
+ # back in a series of RPL_NAMEREPLY messages with a RPL_ENDOFNAMES to
308
+ # mark the end.
309
+ RPL_ENDOFNAMES = 366
310
+
311
+ # @todo Document this constant
312
+ RPL_LINKS = 364
313
+
314
+ # In replying to the LINKS message, a server must send replies back
315
+ # using the RPL_LINKS numeric and mark the end of the list using an
316
+ # RPL_ENDOFLINKS reply.
317
+ RPL_ENDOFLINKS = 365
318
+
319
+ # @todo Document this constant
320
+ RPL_BANLIST = 367
321
+
322
+ # When listing the active 'bans' for a given channel, a server is
323
+ # required to send the list back using the RPL_BANLIST and
324
+ # RPL_ENDOFBANLIST messages. A separate RPL_BANLIST is sent for each
325
+ # active banid. After the banids have been listed (or if none present)
326
+ # a RPL_ENDOFBANLIST must be sent.
327
+ RPL_ENDOFBANLIST = 368
328
+
329
+ # @todo Document this constant
330
+ RPL_INFO = 371
331
+
332
+ # A server responding to an INFO message is required to send all its
333
+ # 'info' in a series of RPL_INFO messages with a RPL_ENDOFINFO reply
334
+ # to indicate the end of the replies.
335
+ RPL_ENDOFINFO = 374
336
+
337
+ # @todo Document this constant
338
+ RPL_MOTDSTART = 375
339
+
340
+ # @todo Document this constant
341
+ RPL_MOTD = 372
342
+
343
+ # When responding to the MOTD message and the MOTD file is found, the
344
+ # file is displayed line by line, with each line no longer than 80
345
+ # characters, using RPL_MOTD format replies. These should be
346
+ # surrounded by a RPL_MOTDSTART (before the RPL_MOTDs) and an
347
+ # RPL_ENDOFMOTD (after).
348
+ RPL_ENDOFMOTD = 376
349
+
350
+ # RPL_YOUREOPER is sent back to a client which has just successfully
351
+ # issued an OPER message and gained operator status.
352
+ RPL_YOUREOPER = 381
353
+
354
+ # If the REHASH option is used and an operator sends a REHASH message,
355
+ # an RPL_REHASHING is sent back to the operator.
356
+ RPL_REHASHING = 382
357
+
358
+ # @todo Document this constant
359
+ RPL_QLIST = 386
360
+
361
+ # @todo Document this constant
362
+ RPL_ENDOFQLIST = 387
363
+
364
+ # When replying to the TIME message, a server must send the reply
365
+ # using the RPL_TIME format above. The string showing the time need
366
+ # only contain the correct day and time there. There is no further
367
+ # requirement for the time string.
368
+ RPL_TIME = 391
369
+
370
+ # @todo Document this constant
371
+ RPL_USERSSTART = 392
372
+
373
+ # @todo Document this constant
374
+ RPL_USERS = 393
375
+
376
+ # @todo Document this constant
377
+ RPL_ENDOFUSERS = 394
378
+
379
+ # If the USERS message is handled by a server, the replies
380
+ # RPL_USERSTART, RPL_USERS, RPL_ENDOFUSERS and RPL_NOUSERS are used.
381
+ # RPL_USERSSTART must be sent first, following by either a sequence of
382
+ # RPL_USERS or a single RPL_NOUSER. Following this is RPL_ENDOFUSERS.
383
+ RPL_NOUSERS = 395
384
+
385
+ # @todo Document this constant
386
+ RPL_TRACELINK = 200
387
+
388
+ # @todo Document this constant
389
+ RPL_TRACECONNECTING = 201
390
+
391
+ # @todo Document this constant
392
+ RPL_TRACEHANDSHAKE = 202
393
+
394
+ # @todo Document this constant
395
+ RPL_TRACEUNKNOWN = 203
396
+
397
+ # @todo Document this constant
398
+ RPL_TRACEOPERATOR = 204
399
+
400
+ # @todo Document this constant
401
+ RPL_TRACEUSER = 205
402
+
403
+ # @todo Document this constant
404
+ RPL_TRACESERVER = 206
405
+
406
+ # @todo Document this constant
407
+ RPL_TRACENEWTYPE = 208
408
+
409
+ # The RPL_TRACE* are all returned by the server in response to the
410
+ # TRACE message. How many are returned is dependent on the the TRACE
411
+ # message and whether it was sent by an operator or not. There is no
412
+ # predefined order for which occurs first. Replies RPL_TRACEUNKNOWN,
413
+ # RPL_TRACECONNECTING and RPL_TRACEHANDSHAKE are all used for
414
+ # connections which have not been fully established and are either
415
+ # unknown, still attempting to connect or in the process of completing
416
+ # the 'server handshake'. RPL_TRACELINK is sent by any server which
417
+ # handles a TRACE message and has to pass it on to another server. The
418
+ # list of RPL_TRACELINKs sent in response to a TRACE command
419
+ # traversing the IRC network should reflect the actual connectivity of
420
+ # the servers themselves along that path. RPL_TRACENEWTYPE is to be
421
+ # used for any connection which does not fit in the other categories
422
+ # but is being displayed anyway.
423
+ RPL_TRACELOG = 261
424
+
425
+ # @todo Document this constant
426
+ RPL_STATSLINKINFO = 211
427
+
428
+ # @todo Document this constant
429
+ RPL_STATSCOMMANDS = 212
430
+
431
+ # @todo Document this constant
432
+ RPL_STATSCLINE = 213
433
+
434
+ # @todo Document this constant
435
+ RPL_STATSNLINE = 214
436
+
437
+ # @todo Document this constant
438
+ RPL_STATSILINE = 215
439
+
440
+ # @todo Document this constant
441
+ RPL_STATSKLINE = 216
442
+
443
+ # @todo Document this constant
444
+ RPL_STATSYLINE = 218
445
+
446
+ # @todo Document this constant
447
+ RPL_ENDOFSTATS = 219
448
+
449
+ # @todo Document this constant
450
+ RPL_STATSLLINE = 241
451
+
452
+ # @todo Document this constant
453
+ RPL_STATSUPTIME = 242
454
+
455
+ # @todo Document this constant
456
+ RPL_STATSOLINE = 243
457
+
458
+ # @todo Document this constant
459
+ RPL_STATSHLINE = 244
460
+
461
+ # To answer a query about a client's own mode, RPL_UMODEIS is sent
462
+ # back.
463
+ RPL_UMODEIS = 221
464
+
465
+ # @todo Document this constant
466
+ RPL_LUSERCLIENT = 251
467
+
468
+ # @todo Document this constant
469
+ RPL_LUSEROP = 252
470
+
471
+ # @todo Document this constant
472
+ RPL_LUSERUNKNOWN = 253
473
+
474
+ # @todo Document this constant
475
+ RPL_LUSERCHANNELS = 254
476
+
477
+ # In processing an LUSERS message, the server sends a set of replies
478
+ # from RPL_LUSERCLIENT, RPL_LUSEROP, RPL_USERUNKNOWN,
479
+ # RPL_LUSERCHANNELS and RPL_LUSERME. When replying, a server must send
480
+ # back RPL_LUSERCLIENT and RPL_LUSERME. The other replies are only
481
+ # sent back if a non-zero count is found for them.
482
+ RPL_LUSERME = 255
483
+
484
+ # @todo Document this constant
485
+ RPL_ADMINME = 256
486
+
487
+ # @todo Document this constant
488
+ RPL_ADMINLOC1 = 257
489
+
490
+ # @todo Document this constant
491
+ RPL_ADMINLOC2 = 258
492
+
493
+ # When replying to an ADMIN message, a server is expected to use
494
+ # replies RLP_ADMINME through to RPL_ADMINEMAIL and provide a text
495
+ # message with each. For RPL_ADMINLOC1 a description of what city,
496
+ # state and country the server is in is expected, followed by details
497
+ # of the university and department (RPL_ADMINLOC2) and finally the
498
+ # administrative contact for the server (an email address here is
499
+ # required) in RPL_ADMINEMAIL.
500
+ RPL_ADMINEMAIL = 259
501
+
502
+ # @todo Document this constant
503
+ RPL_MONONLINE = 730
504
+
505
+ # @todo Document this constant
506
+ RPL_MONOFFLINE = 731
507
+
508
+ # @todo Document this constant
509
+ RPL_MONLIST = 732
510
+
511
+ # @todo Document this constant
512
+ RPL_ENDOFMONLIST = 733
513
+
514
+ # @todo Document this constant
515
+ ERR_MONLISTFULL = 734
516
+
517
+ # @todo Document this constant
518
+ RPL_SASLLOGIN = 900
519
+
520
+ # @todo Document this constant
521
+ RPL_SASLSUCCESS = 903
522
+
523
+ # @todo Document this constant
524
+ RPL_SASLFAILED = 904
525
+
526
+ # @todo Document this constant
527
+ RPL_SASLERROR = 905
528
+
529
+ # @todo Document this constant
530
+ RPL_SASLABORT = 906
531
+
532
+ # @todo Document this constant
533
+ RPL_SASLALREADYAUTH = 907
534
+ end
535
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cinch
4
+ module DCC
5
+ # This module describes the required interface for objects that should
6
+ # be sendable via DCC.
7
+ #
8
+ # @note `File` conforms to this interface.
9
+ # @since 2.0.0
10
+ # @abstract
11
+ module DCCableObject
12
+ # Return the next `number` bytes of the object.
13
+ #
14
+ # @param [Integer] number Read `number` bytes at most
15
+ # @return [String] The read data
16
+ # @return [nil] If no more data can be read
17
+ def read(number)
18
+ end
19
+
20
+ # Seek to a specific position.
21
+ #
22
+ # @param [Integer] position The position in bytes to seek to
23
+ # @return [void]
24
+ def seek(position)
25
+ end
26
+
27
+ # @return [String] A string representing the object's path or name.
28
+ #
29
+ # @note This is only required if calling {User#dcc_send} with only
30
+ # one argument
31
+ def path
32
+ end
33
+
34
+ # @return [Integer] The total size of the data, in bytes.
35
+ def size
36
+ end
37
+ end
38
+ end
39
+ end