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