hector 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,7 +29,7 @@ module Hector
29
29
 
30
30
  def normalize(name)
31
31
  name.force_encoding("UTF-8") if name.respond_to?(:force_encoding)
32
- if name =~ /^#[\p{L}\p{M}\p{N}\p{So}\p{Co}\w][\p{L}\p{M}\p{N}\p{So}\p{Co}\p{Pd}\p{Pc}\w-]{0,15}$/u
32
+ if name =~ /^[#&+!][#&+!\-\w\p{L}\p{M}\p{N}\p{S}\p{P}\p{Co}]{1,49}$/u && name !~ /,/
33
33
  name.downcase
34
34
  else
35
35
  raise NoSuchChannel, name
@@ -2,7 +2,7 @@ module Hector
2
2
  module Commands
3
3
  module Join
4
4
  def on_join
5
- request.args.first.split(",").each do |channel_name|
5
+ request.args.first.split(/,(?=[#&+!])/).each do |channel_name|
6
6
  channel = Channel.find_or_create(channel_name)
7
7
  if channel.join(self)
8
8
  channel.broadcast(:join, :source => source, :text => channel.name)
@@ -26,10 +26,11 @@ module Hector
26
26
  def initialize(command, *args)
27
27
  @command = command.to_s.upcase
28
28
  @args = args
29
-
29
+
30
30
  options = args.pop if args.last.is_a?(Hash)
31
31
  @text = options[:text] if options
32
32
  @source = options[:source] if options
33
+ @source ||= Hector.server_name if @command =~ /^\d+$/
33
34
  end
34
35
 
35
36
  def event_name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-30 00:00:00.000000000 Z
12
+ date: 2012-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
16
- requirement: &70333252105960 !ruby/object:Gem::Requirement
16
+ requirement: &70163681226360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.12.10
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70333252105960
24
+ version_requirements: *70163681226360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mocha
27
- requirement: &70333252105320 !ruby/object:Gem::Requirement
27
+ requirement: &70163681225880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 0.9.9
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70333252105320
35
+ version_requirements: *70163681225880
36
36
  description: A private group chat server for people you trust. Implements a limited
37
37
  subset of the IRC protocol.
38
38
  email: