summaryrefslogtreecommitdiff
path: root/lib/rbot/rfc2812.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-06 13:54:27 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-06 13:54:27 +0000
commit9b03d79f79ac820a1940aa78d30302a83c9db160 (patch)
tree53b086121496ad788932291b1f5e7f5f3f447381 /lib/rbot/rfc2812.rb
parent9db57bfc3d38cae306b6915140fc693811959ac9 (diff)
New IRC Framework: topic setter should be a Netmask, not a User. Also improve display of Netmasks with unknown (generic) user/host components
Diffstat (limited to 'lib/rbot/rfc2812.rb')
-rw-r--r--lib/rbot/rfc2812.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb
index f11fd6bc..5174203f 100644
--- a/lib/rbot/rfc2812.rb
+++ b/lib/rbot/rfc2812.rb
@@ -1001,11 +1001,15 @@ module Irc
when RPL_TOPIC_INFO
data[:nick] = @server.user(argv[0])
data[:channel] = @server.get_channel(argv[1])
- data[:source] = @server.user(argv[2])
+
+ # This must not be an IRC::User because it might not be an actual User,
+ # and we risk overwriting valid User data
+ data[:source] = argv[2].to_irc_netmask(:server => @server)
+
data[:time] = Time.at(argv[3].to_i)
if data[:channel]
- data[:channel].topic.set_by = data[:nick]
+ data[:channel].topic.set_by = data[:source]
data[:channel].topic.set_on = data[:time]
else
warning "Received topic #{data[:topic].inspect} for channel #{data[:channel].inspect} I was not on"