summaryrefslogtreecommitdiff
path: root/lib/rbot/rfc2812.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-06-28 21:01:19 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-06-28 21:01:19 +0200
commitd5b21e2be33f7d8a3bb471f294a2c88410c84c5f (patch)
tree71c00ae2af89486964d3e974846950f8606a1c3b /lib/rbot/rfc2812.rb
parent3629cc0bfd4ccb6c309d30021be8a4011f551ca9 (diff)
New IRC framework: allow RPL_TOPIC(_INFO) for channels we are not on, since some networks allow it
Diffstat (limited to 'lib/rbot/rfc2812.rb')
-rw-r--r--lib/rbot/rfc2812.rb19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb
index 0100fc3c..378036de 100644
--- a/lib/rbot/rfc2812.rb
+++ b/lib/rbot/rfc2812.rb
@@ -1122,19 +1122,14 @@ module Irc
data[:message] = argv[2]
handle(:badnick, data)
when RPL_TOPIC
- data[:channel] = @server.get_channel(argv[1])
+ data[:channel] = @server.channel(argv[1])
data[:topic] = argv[2]
-
- if data[:channel]
- data[:channel].topic.text = data[:topic]
- else
- warning "Received topic #{data[:topic].inspect} for channel #{data[:channel].inspect} I was not on"
- end
+ data[:channel].topic.text = data[:topic]
handle(:topic, data)
when RPL_TOPIC_INFO
data[:nick] = @server.user(argv[0])
- data[:channel] = @server.get_channel(argv[1])
+ data[:channel] = @server.channel(argv[1])
# This must not be an IRC::User because it might not be an actual User,
# and we risk overwriting valid User data
@@ -1142,12 +1137,8 @@ module Irc
data[:time] = Time.at(argv[3].to_i)
- if data[:channel]
- 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"
- end
+ data[:channel].topic.set_by = data[:source]
+ data[:channel].topic.set_on = data[:time]
handle(:topicinfo, data)
when RPL_NAMREPLY