summaryrefslogtreecommitdiff
path: root/lib/rbot/messagemapper.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-08-03 14:06:15 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-08-03 14:06:15 +0000
commit6bf3094ac4ad043f00a3ef8cc2af48a8c23d114a (patch)
tree2729e8a8480a45b252f89b241250ef2b84dc3163 /lib/rbot/messagemapper.rb
parent03bb46bbe744034141a3b612da4f0083719ff9a2 (diff)
Lots of fixes all around, in preparation for the new auth coremodule
Diffstat (limited to 'lib/rbot/messagemapper.rb')
-rw-r--r--lib/rbot/messagemapper.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb
index 2214780b..193804fe 100644
--- a/lib/rbot/messagemapper.rb
+++ b/lib/rbot/messagemapper.rb
@@ -178,16 +178,23 @@ module Irc
else
raise ArgumentError, "Can't find auth base in #{botmodule.inspect}"
end
- post = items.reject{ |x|
+ words = items.reject{ |x|
x == pre || x.kind_of?(Symbol)
}
- if post.empty?
+ if words.empty?
post = nil
else
- post = post.first
+ post = words.first
end
if hash.has_key?(:auth_path)
extra = hash[:auth_path]
+ if extra.sub!(/^:/, "")
+ pre += post
+ post = nil
+ end
+ if extra.sub!(/:$/, "")
+ post = [post,words[1]].compact.join("::") if words.length > 1
+ end
pre = nil if extra.sub!(/^!/, "")
post = nil if extra.sub!(/!$/, "")
else