diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-08-06 23:27:51 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-08-06 23:27:51 +0000 |
commit | c7eab99603c757ac4202e809f5c5923fa23e65ff (patch) | |
tree | 277ec59ae79aabfe5c987a83f46b404bb232c662 /data/rbot | |
parent | 7142123955bcd73a554564f361125f8da5255b83 (diff) |
Fix RSS plugin problems caused by watches created before the new Irc framework
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/rss.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index b49b6a1d..03bb0b42 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -1,7 +1,12 @@ +#-- vim:sw=2:et
+#++
+#
# RSS feed plugin for RubyBot
# (c) 2004 Stanislav Karchebny <berkus@madfire.net>
# (c) 2005 Ian Monroe <ian@monroe.nu>
# (c) 2005 Mark Kretschmann <markey@web.de>
+# (c) 2006 Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
+#
# Licensed under MIT License.
require 'rss/parser'
@@ -54,19 +59,26 @@ class ::RssBlob end
def watched_by?(who)
- @watchers.include?(who)
+ # We need to check bot 'who' itself and the String form, because rss
+ # watches added before the new Irc framework represented watchers as
+ # Strings whereas they are now Channels.
+ #
+ @watchers.include?(who) || @watchers.include?(who.to_s)
end
def add_watch(who)
if watched_by?(who)
return nil
end
- @watchers << who unless watched_by?(who)
+ @watchers << who
return who
end
def rm_watch(who)
+ # See comment to watched_by?
+ #
@watchers.delete(who)
+ @watchers.delete(who.to_s)
end
def to_a
|