konn-rupircd 0.6.3 → 0.6.4

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.3
1
+ 0.6.4
@@ -35,7 +35,7 @@ class IRCServer < WEBrick::GenericServer
35
35
  def define_oper_command(mtd, &pr)
36
36
  define_method(mtd){|usr, param|
37
37
  if usr.operator || usr.local_operator
38
- instance_eval(&pr)
38
+ instance_exec(usr, param, &pr)
39
39
  else
40
40
  send_server_message(usr, "481", "Permission Denied - You're not an IRC operator")
41
41
  end
@@ -235,7 +235,6 @@ class IRCServer < WEBrick::GenericServer
235
235
 
236
236
  define_oper_command :on_rehash do |usr, params|
237
237
  cnf = @fconf.load
238
-
239
238
  if Hash === cnf
240
239
  config.replace(cnf)
241
240
  send_server_message(usr, "382", "#{@fconf.path} :Rehashing")
@@ -281,6 +280,10 @@ class IRCServer < WEBrick::GenericServer
281
280
  send_server_message(user, "219", c.chr, "End of STATS report")
282
281
  end
283
282
 
283
+ def class_for_chname(chname)
284
+ # overridden in sub-classes
285
+ end
286
+
284
287
  def on_join(user, params)
285
288
  if params[0] == "0"
286
289
  user.joined_channels.each{|ch|
@@ -292,11 +295,6 @@ class IRCServer < WEBrick::GenericServer
292
295
  keys = params[1].split(",") if params.size >= 2
293
296
  keys ||= []
294
297
  chs.each_with_index{|ch, i|
295
- unless channame?(ch)
296
- send_server_message(user, "403", ch, "No such channel")
297
- next
298
- end
299
-
300
298
  chclass = case ch
301
299
  when /^\+/
302
300
  NoModeChannel
@@ -304,6 +302,13 @@ class IRCServer < WEBrick::GenericServer
304
302
  Channel
305
303
  when /^!#/
306
304
  SafeChannel
305
+ else
306
+ if klass = class_for_chname(ch)
307
+ klass
308
+ else
309
+ send_server_message(user, "403", ch, "No such channel")
310
+ next
311
+ end
307
312
  end
308
313
  unless @channels.has_key?(ch.downcase)
309
314
  set_channel(ch, chclass.new(self, user, ch) )
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rupircd}
8
- s.version = "0.6.3"
8
+ s.version = "0.6.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["konn"]
12
- s.date = %q{2009-08-13}
12
+ s.date = %q{2009-08-16}
13
13
  s.description = %q{rupircd is a light IRC daemon written in 100% pure ruby.}
14
14
  s.email = %q{mr_konn[at]jcom[dot]home[dot]ne[dot]jp}
15
15
  s.executables = ["mkpassword", "rupircd"]
@@ -1,9 +1,9 @@
1
- Conf = {
1
+ {
2
2
  :Motd => open("motd.txt"){|f| f.read },
3
3
  :Info => open("info.txt"){|f| f.read },
4
4
  :Port => 6667,
5
5
  :Opers => {"superoper*"=>"329435e5e66be809a656af105f42401e"},
6
- # :Encoding => "UTF-8",
6
+ :Encoding => "UTF-8",
7
7
  :MaxClients => 100,
8
8
  :PINGInterval => 10,
9
9
  :PINGLimit => 90,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konn-rupircd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - konn
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-13 00:00:00 -07:00
12
+ date: 2009-08-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15