summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/ircbot.rb4
-rw-r--r--lib/rbot/message.rb9
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index a22d1772..18e9e57c 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -685,7 +685,9 @@ class Bot
@plugins.irc_delegate("topic", m)
}
@client[:names] = proc { |data|
- @plugins.delegate "names", data[:channel], data[:users]
+ m = NamesMessage.new(self, server, server, data[:channel])
+ m.users = data[:users]
+ @plugins.delegate "names", m
}
@client[:unknown] = proc { |data|
#debug "UNKNOWN: #{data[:serverstring]}"
diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb
index 494b6877..b433bee3 100644
--- a/lib/rbot/message.rb
+++ b/lib/rbot/message.rb
@@ -472,6 +472,15 @@ module Irc
end
end
+ # class to manage NAME replies
+ class NamesMessage < BasicUserMessage
+ attr_accessor :users
+ def initialize(bot, server, source, target, message="")
+ super(bot, server, source, target, message)
+ @users = []
+ end
+ end
+
class QuitMessage < BasicUserMessage
def initialize(bot, server, source, target, message="")
super(bot, server, source, target, message)