ircguerilla-irc 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/irc/client/client_error.rb +35 -0
- data/lib/irc/client/command_handler.rb +113 -0
- data/lib/irc/client/connected_state.rb +95 -0
- data/lib/irc/client/connection.rb +119 -0
- data/lib/irc/client/connection_listener.rb +97 -0
- data/lib/irc/client/connection_state.rb +88 -0
- data/lib/irc/client/context.rb +250 -0
- data/lib/irc/client/disconnected_state.rb +132 -0
- data/lib/irc/client/message_handler.rb +87 -0
- data/lib/irc/client/registered_state.rb +90 -0
- data/lib/irc/client/unregistered_state.rb +113 -0
- data/lib/irc/commands/command.rb +57 -0
- data/lib/irc/commands/invalid_command.rb +35 -0
- data/lib/irc/commands/join_command.rb +122 -0
- data/lib/irc/commands/nick_command.rb +86 -0
- data/lib/irc/commands/part_command.rb +84 -0
- data/lib/irc/commands/password_command.rb +72 -0
- data/lib/irc/commands/ping_command.rb +79 -0
- data/lib/irc/commands/pong_command.rb +68 -0
- data/lib/irc/commands/quit_command.rb +77 -0
- data/lib/irc/commands/user_command.rb +105 -0
- data/lib/irc/messages/codes.rb +186 -0
- data/lib/irc/messages/error_join_message.rb +72 -0
- data/lib/irc/messages/error_message.rb +101 -0
- data/lib/irc/messages/factory.rb +122 -0
- data/lib/irc/messages/invalid_message.rb +35 -0
- data/lib/irc/messages/join_message.rb +130 -0
- data/lib/irc/messages/message.rb +110 -0
- data/lib/irc/messages/nick_message.rb +93 -0
- data/lib/irc/messages/notice_message.rb +87 -0
- data/lib/irc/messages/part_message.rb +95 -0
- data/lib/irc/messages/ping_message.rb +101 -0
- data/lib/irc/messages/pong_message.rb +89 -0
- data/lib/irc/messages/private_message.rb +121 -0
- data/lib/irc/models/bot.rb +159 -0
- data/lib/irc/models/channel.rb +158 -0
- data/lib/irc/models/network.rb +252 -0
- data/lib/irc/models/packet.rb +84 -0
- data/lib/irc/models/server.rb +116 -0
- data/lib/irc/models/user.rb +112 -0
- data/test/functional/irc/client/connection_test.rb +118 -0
- data/test/functional/irc/client/context_test.rb +126 -0
- data/test/test_helper.rb +32 -0
- data/test/unit/irc/client/command_handler_test.rb +137 -0
- data/test/unit/irc/commands/join_command_test.rb +72 -0
- data/test/unit/irc/commands/nick_command_test.rb +35 -0
- data/test/unit/irc/commands/part_command_test.rb +52 -0
- data/test/unit/irc/commands/password_command_test.rb +35 -0
- data/test/unit/irc/commands/ping_command_test.rb +36 -0
- data/test/unit/irc/commands/pong_command_test.rb +36 -0
- data/test/unit/irc/commands/quit_command_test.rb +35 -0
- data/test/unit/irc/commands/user_command_test.rb +35 -0
- data/test/unit/irc/messages/error_join_message_test.rb +45 -0
- data/test/unit/irc/messages/factory_test.rb +62 -0
- data/test/unit/irc/messages/join_message_test.rb +46 -0
- data/test/unit/irc/messages/message_test.rb +56 -0
- data/test/unit/irc/messages/nick_message_test.rb +48 -0
- data/test/unit/irc/messages/notice_message_test.rb +43 -0
- data/test/unit/irc/messages/part_message_test.rb +47 -0
- data/test/unit/irc/messages/ping_message_test.rb +57 -0
- data/test/unit/irc/messages/pong_message_test.rb +57 -0
- data/test/unit/irc/messages/private_message_test.rb +42 -0
- data/test/unit/irc/models/bot_test.rb +85 -0
- data/test/unit/irc/models/channel_test.rb +90 -0
- data/test/unit/irc/models/network_test.rb +210 -0
- data/test/unit/irc/models/packet_test.rb +38 -0
- data/test/unit/irc/models/server_test.rb +54 -0
- data/test/unit/irc/models/user_test.rb +67 -0
- metadata +111 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (c) 2006 Roman Scherer | IRC Guerilla | Rapid Packet Movement
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
#
|
24
|
+
# $Id: user_command.rb 85 2006-08-13 11:42:07Z roman $
|
25
|
+
#
|
26
|
+
require 'irc/commands/command'
|
27
|
+
require 'irc/commands/invalid_command'
|
28
|
+
|
29
|
+
module IRC
|
30
|
+
|
31
|
+
module Commands
|
32
|
+
|
33
|
+
# Command: USER
|
34
|
+
#
|
35
|
+
# Parameters: <username> <hostname> <servername> <realname>
|
36
|
+
#
|
37
|
+
# The USER message is used at the beginning of connection to specify the
|
38
|
+
# username, hostname, servername and realname of s new user. It is also
|
39
|
+
# used in communication between servers to indicate new user arriving on
|
40
|
+
# IRC, since only after both USER and NICK have been received from a client
|
41
|
+
# does a user become registered.
|
42
|
+
#
|
43
|
+
# Between servers USER must to be prefixed with client's NICKname. Note that
|
44
|
+
# hostname and servername are normally ignored by the IRC server when the USER
|
45
|
+
# command comes from a directly connected client (for security reasons), but
|
46
|
+
# they are used in server to server communication. This means that a NICK must
|
47
|
+
# always be sent to a remote server when a new user is being introduced to the
|
48
|
+
# rest of the network before the accompanying USER is sent.
|
49
|
+
#
|
50
|
+
# It must be noted that realname parameter must be the last parameter, because
|
51
|
+
# it may contain space characters and must be prefixed with a colon (':') to
|
52
|
+
# make sure this is recognised as such.
|
53
|
+
#
|
54
|
+
# Since it is easy for a client to lie about its username by relying solely on
|
55
|
+
# the USER message, the use of an "Identity Server" is recommended. If the host
|
56
|
+
# which a user connects from has such a server enabled the username is set to
|
57
|
+
# that as in the reply from the "Identity Server".
|
58
|
+
#
|
59
|
+
# Numeric Replies:
|
60
|
+
#
|
61
|
+
# ERR_NEEDMOREPARAMS
|
62
|
+
# ERR_ALREADYREGISTRED
|
63
|
+
#
|
64
|
+
# Examples:
|
65
|
+
#
|
66
|
+
# User registering themselves with a username of "guest" and real name "Ronnie Reagan".
|
67
|
+
#
|
68
|
+
# USER guest tolmoon tolsun :Ronnie Reagan
|
69
|
+
#
|
70
|
+
# Message between servers with the nickname for which the USER command belongs to
|
71
|
+
#
|
72
|
+
# :testnick USER guest tolmoon tolsun :Ronnie Reagan
|
73
|
+
#
|
74
|
+
class UserCommand < Command
|
75
|
+
|
76
|
+
attr_reader :user
|
77
|
+
attr_reader :host
|
78
|
+
attr_reader :server
|
79
|
+
attr_reader :realname
|
80
|
+
|
81
|
+
def initialize(user, host, server, realname)
|
82
|
+
|
83
|
+
raise InvalidCommand.new("Can't create user command. No user name.") unless user
|
84
|
+
@user = user
|
85
|
+
|
86
|
+
raise InvalidCommand.new("Can't create user command. No host.") unless host
|
87
|
+
@host = host
|
88
|
+
|
89
|
+
raise InvalidCommand.new("Can't create user command. No server.") unless server
|
90
|
+
@server = server
|
91
|
+
|
92
|
+
raise InvalidCommand.new("Can't create user command. No real name.") unless realname
|
93
|
+
@realname = realname
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
def command
|
98
|
+
return "USER #{user} #{host} #{server} :#{realname}"
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
@@ -0,0 +1,186 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (c) 2006 Roman Scherer | IRC Guerilla | Rapid Packet Movement
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
#
|
24
|
+
# $Id: codes.rb 85 2006-08-13 11:42:07Z roman $
|
25
|
+
#
|
26
|
+
module IRC
|
27
|
+
|
28
|
+
module Messages
|
29
|
+
|
30
|
+
module Codes
|
31
|
+
|
32
|
+
# Reply codes
|
33
|
+
RPL_WELCOME = 001
|
34
|
+
RPL_YOURHOST = 002
|
35
|
+
RPL_CREATED = 003
|
36
|
+
RPL_MYINFO = 004
|
37
|
+
RPL_BOUNCE = 005
|
38
|
+
RPL_ISUPPORT = 005
|
39
|
+
RPL_TRACELINK = 200
|
40
|
+
RPL_TRACECONNECTING = 201
|
41
|
+
RPL_TRACEHANDSHAKE = 202
|
42
|
+
RPL_TRACEUNKNOWN = 203
|
43
|
+
RPL_TRACEOPERATOR = 204
|
44
|
+
RPL_TRACEUSER = 205
|
45
|
+
RPL_TRACESERVER = 206
|
46
|
+
RPL_TRACENEWTYPE = 208
|
47
|
+
RPL_TRACECLASS = 209
|
48
|
+
RPL_STATSLINKINFO = 211
|
49
|
+
RPL_STATSCOMMANDS = 212
|
50
|
+
RPL_STATSCLINE = 213
|
51
|
+
RPL_STATSNLINE = 214
|
52
|
+
RPL_STATSILINE = 215
|
53
|
+
RPL_STATSKLINE = 216
|
54
|
+
RPL_STATSQLINE = 217
|
55
|
+
RPL_STATSYLINE = 218
|
56
|
+
RPL_ENDOFSTATS = 219
|
57
|
+
RPL_UMODEIS = 221
|
58
|
+
RPL_SERVICEINFO = 231
|
59
|
+
RPL_ENDOFSERVICES = 232
|
60
|
+
RPL_SERVICE = 233
|
61
|
+
RPL_SERVLIST = 234
|
62
|
+
RPL_SERVLISTEND = 235
|
63
|
+
RPL_STATSLLINE = 241
|
64
|
+
RPL_STATSUPTIME = 242
|
65
|
+
RPL_STATSOLINE = 243
|
66
|
+
RPL_STATSHLINE = 244
|
67
|
+
RPL_LUSERCLIENT = 251
|
68
|
+
RPL_LUSEROP = 252
|
69
|
+
RPL_LUSERUNKNOWN = 253
|
70
|
+
RPL_LUSERCHANNELS = 254
|
71
|
+
RPL_LUSERME = 255
|
72
|
+
RPL_ADMINME = 256
|
73
|
+
RPL_ADMINLOC1 = 257
|
74
|
+
RPL_ADMINLOC2 = 258
|
75
|
+
RPL_ADMINEMAIL = 259
|
76
|
+
RPL_TRACELOG = 261
|
77
|
+
RPL_NONE = 300
|
78
|
+
RPL_AWAY = 301
|
79
|
+
RPL_USERHOST = 302
|
80
|
+
RPL_ISON = 303
|
81
|
+
RPL_UNAWAY = 305
|
82
|
+
RPL_NOWAWAY = 306
|
83
|
+
RPL_WHOISUSER = 311
|
84
|
+
RPL_WHOISSERVER = 312
|
85
|
+
RPL_WHOISOPERATOR = 313
|
86
|
+
RPL_WHOWASUSER = 314
|
87
|
+
RPL_ENDOFWHO = 315
|
88
|
+
RPL_WHOISCHANOP = 316
|
89
|
+
RPL_WHOISIDLE = 317
|
90
|
+
RPL_ENDOFWHOIS = 318
|
91
|
+
RPL_WHOISCHANNELS = 319
|
92
|
+
RPL_LISTSTART = 321
|
93
|
+
RPL_LIST = 322
|
94
|
+
RPL_LISTEND = 323
|
95
|
+
RPL_CHANNELMODEIS = 324
|
96
|
+
RPL_NOTOPIC = 331
|
97
|
+
RPL_TOPIC = 332
|
98
|
+
RPL_TOPICINFO = 333
|
99
|
+
RPL_INVITING = 341
|
100
|
+
RPL_SUMMONING = 342
|
101
|
+
RPL_VERSION = 351
|
102
|
+
RPL_WHOREPLY = 352
|
103
|
+
RPL_NAMREPLY = 353
|
104
|
+
RPL_KILLDONE = 361
|
105
|
+
RPL_CLOSING = 362
|
106
|
+
RPL_CLOSEEND = 363
|
107
|
+
RPL_LINKS = 364
|
108
|
+
RPL_ENDOFLINKS = 365
|
109
|
+
RPL_ENDOFNAMES = 366
|
110
|
+
RPL_BANLIST = 367
|
111
|
+
RPL_ENDOFBANLIST = 368
|
112
|
+
RPL_ENDOFWHOWAS = 369
|
113
|
+
RPL_INFO = 371
|
114
|
+
RPL_MOTD = 372
|
115
|
+
RPL_INFOSTART = 373
|
116
|
+
RPL_ENDOFINFO = 374
|
117
|
+
RPL_MOTDSTART = 375
|
118
|
+
RPL_ENDOFMOTD = 376
|
119
|
+
RPL_YOUREOPER = 381
|
120
|
+
RPL_REHASHING = 382
|
121
|
+
RPL_MYPORTIS = 384
|
122
|
+
RPL_TIME = 391
|
123
|
+
RPL_USERSSTART = 392
|
124
|
+
RPL_USERS = 393
|
125
|
+
RPL_ENDOFUSERS = 394
|
126
|
+
RPL_NOUSERS = 395
|
127
|
+
|
128
|
+
# Error reply codes
|
129
|
+
ERR_NOSUCHNICK = 401
|
130
|
+
ERR_NOSUCHSERVER = 402
|
131
|
+
ERR_NOSUCHCHANNEL = 403
|
132
|
+
ERR_CANNOTSENDTOCHAN = 404
|
133
|
+
ERR_TOOMANYCHANNELS = 405
|
134
|
+
ERR_WASNOSUCHNICK = 406
|
135
|
+
ERR_TOOMANYTARGETS = 407
|
136
|
+
ERR_NOORIGIN = 409
|
137
|
+
ERR_NORECIPIENT = 411
|
138
|
+
ERR_NOTEXTTOSEND = 412
|
139
|
+
ERR_NOTOPLEVEL = 413
|
140
|
+
ERR_WILDTOPLEVEL = 414
|
141
|
+
ERR_UNKNOWNCOMMAND = 421
|
142
|
+
ERR_NOMOTD = 422
|
143
|
+
ERR_NOADMININFO = 423
|
144
|
+
ERR_FILEERROR = 424
|
145
|
+
ERR_NONICKNAMEGIVEN = 431
|
146
|
+
ERR_ERRONEUSNICKNAME = 432
|
147
|
+
ERR_NICKNAMEINUSE = 433
|
148
|
+
ERR_NICKCOLLISION = 436
|
149
|
+
ERR_TARGETTOOFAST = 439
|
150
|
+
ERR_USERNOTINCHANNEL = 441
|
151
|
+
ERR_NOTONCHANNEL = 442
|
152
|
+
ERR_USERONCHANNEL = 443
|
153
|
+
ERR_NOLOGIN = 444
|
154
|
+
ERR_SUMMONDISABLED = 445
|
155
|
+
ERR_USERSDISABLED = 446
|
156
|
+
ERR_NOTREGISTERED = 451
|
157
|
+
ERR_NEEDMOREPARAMS = 461
|
158
|
+
ERR_ALREADYREGISTRED = 462
|
159
|
+
ERR_NOPERMFORHOST = 463
|
160
|
+
ERR_PASSWDMISMATCH = 464
|
161
|
+
ERR_YOUREBANNEDCREEP = 465
|
162
|
+
ERR_YOUWILLBEBANNED = 466
|
163
|
+
ERR_KEYSET = 467
|
164
|
+
ERR_INVALIDUSERNAME = 468
|
165
|
+
ERR_LINKCHANNEL = 470
|
166
|
+
ERR_CHANNELISFULL = 471
|
167
|
+
ERR_UNKNOWNMODE = 472
|
168
|
+
ERR_INVITEONLYCHAN = 473
|
169
|
+
ERR_BANNEDFROMCHAN = 474
|
170
|
+
ERR_BADCHANNELKEY = 475
|
171
|
+
ERR_BADCHANMASK = 476
|
172
|
+
ERR_BADCHANNAME = 479
|
173
|
+
ERR_NOPRIVILEGES = 481
|
174
|
+
ERR_CHANOPRIVSNEEDED = 482
|
175
|
+
ERR_CANTKILLSERVER = 483
|
176
|
+
ERR_SECUREONLYCHAN = 489
|
177
|
+
ERR_NOOPERHOST = 491
|
178
|
+
ERR_NOSERVICEHOST = 492
|
179
|
+
ERR_UMODEUNKNOWNFLAG = 501
|
180
|
+
ERR_USERSDONTMATCH = 502
|
181
|
+
|
182
|
+
end
|
183
|
+
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (c) 2006 Roman Scherer | IRC Guerilla | Rapid Packet Movement
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
#
|
24
|
+
# $Id$
|
25
|
+
#
|
26
|
+
require 'irc/messages/error_join_message'
|
27
|
+
require 'irc/messages/invalid_message'
|
28
|
+
require 'irc/messages/message'
|
29
|
+
|
30
|
+
module IRC
|
31
|
+
|
32
|
+
module Messages
|
33
|
+
|
34
|
+
class ErrorJoinMessage < Message
|
35
|
+
|
36
|
+
attr_reader :channel
|
37
|
+
attr_reader :reason
|
38
|
+
|
39
|
+
# Notify all connection listeners, that the channel join failed.
|
40
|
+
def handle(context)
|
41
|
+
|
42
|
+
# Notify all connection listeners by calling their on_server_response method.
|
43
|
+
super(context)
|
44
|
+
|
45
|
+
# Notify all connection listeners by calling their on_join_failure method.
|
46
|
+
notify(context) do |connection_listener|
|
47
|
+
connection_listener.on_join_failure(context, context.lookup_channel(channel), code, reason)
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
protected
|
53
|
+
|
54
|
+
def parse(raw_message)
|
55
|
+
|
56
|
+
# Initialize the base message fields.
|
57
|
+
super(raw_message)
|
58
|
+
|
59
|
+
match_data = Regexp.new('(\S+)\s+(\S+)\s+:?(.+)').match(message)
|
60
|
+
raise InvalidMessage.new("Can't parse join error message. Invalid message format.") unless match_data
|
61
|
+
|
62
|
+
# Extract nick & channel name and the error reason.
|
63
|
+
@nick, @channel, @reason = match_data[1], match_data[2], match_data[3]
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (c) 2006 Roman Scherer | IRC Guerilla | Rapid Packet Movement
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
#
|
24
|
+
# $Id: error_message.rb 94 2006-08-13 21:40:40Z roman $
|
25
|
+
#
|
26
|
+
require 'irc/messages/error_join_message'
|
27
|
+
require 'irc/messages/message'
|
28
|
+
require 'irc/messages/invalid_message'
|
29
|
+
|
30
|
+
module IRC
|
31
|
+
|
32
|
+
module Messages
|
33
|
+
|
34
|
+
class ErrorMessage < Message
|
35
|
+
end
|
36
|
+
|
37
|
+
class JoinFailureMessage < ErrorMessage
|
38
|
+
end
|
39
|
+
|
40
|
+
class PartFailureMessage < ErrorMessage
|
41
|
+
end
|
42
|
+
|
43
|
+
class ErrorAlreadyRegisteredMessage < ErrorMessage
|
44
|
+
CODE = ERR_ALREADYREGISTRED
|
45
|
+
end
|
46
|
+
|
47
|
+
class ErrorBadChannelKeyMessage < ErrorJoinMessage
|
48
|
+
CODE = ERR_BADCHANNELKEY
|
49
|
+
end
|
50
|
+
|
51
|
+
class ErrorBadChannelMaskMessage < ErrorJoinMessage
|
52
|
+
CODE = ERR_BADCHANMASK
|
53
|
+
end
|
54
|
+
|
55
|
+
class ErrorBannedFromChannelMessage < ErrorJoinMessage
|
56
|
+
CODE = ERR_BANNEDFROMCHAN
|
57
|
+
end
|
58
|
+
|
59
|
+
class ErrorChannelIsFulMessage < ErrorJoinMessage
|
60
|
+
CODE = ERR_CHANNELISFULL
|
61
|
+
end
|
62
|
+
|
63
|
+
class ErrorErroneusNickNameMessage < ErrorMessage
|
64
|
+
CODE = ERR_ERRONEUSNICKNAME
|
65
|
+
end
|
66
|
+
|
67
|
+
class ErrorInviteOnlyChannelMessage < ErrorJoinMessage
|
68
|
+
CODE = ERR_INVITEONLYCHAN
|
69
|
+
end
|
70
|
+
|
71
|
+
class ErrorNeedMoreParametersMessage < ErrorMessage
|
72
|
+
CODE = ERR_NEEDMOREPARAMS
|
73
|
+
end
|
74
|
+
|
75
|
+
class ErrorNickCollisionMessage < ErrorMessage
|
76
|
+
CODE = ERR_NICKCOLLISION
|
77
|
+
end
|
78
|
+
|
79
|
+
class ErrorNickNameInUseMessage < ErrorMessage
|
80
|
+
CODE = ERR_ERRONEUSNICKNAME
|
81
|
+
end
|
82
|
+
|
83
|
+
class ErrorNoNickNameGivenMessage < ErrorMessage
|
84
|
+
CODE = ERR_NONICKNAMEGIVEN
|
85
|
+
end
|
86
|
+
|
87
|
+
class ErrorNoSuchChannelMessage < ErrorJoinMessage
|
88
|
+
CODE = ERR_NOSUCHCHANNEL
|
89
|
+
end
|
90
|
+
|
91
|
+
class ErrorNotOnChannelMessage < ErrorMessage
|
92
|
+
CODE = ERR_NOTONCHANNEL
|
93
|
+
end
|
94
|
+
|
95
|
+
class ErrorTooManyChannelsMessage < ErrorJoinMessage
|
96
|
+
CODE = ERR_TOOMANYCHANNELS
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|