summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-12-13 12:24:49 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-12-13 12:24:49 +0000
commita40dd6600bf0b1e35b29ff12783e218efc0f9273 (patch)
tree9695b7fb8d835184d7673df8eedc8f11595dda2b /data
parentb53b5ba18f35014570af5696e6e9794be84655b7 (diff)
rss: rss rewatch now accepts an optional handle to force rewatching that particular feed
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/rss.rb24
1 files changed, 17 insertions, 7 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index 2d72312a..59357d0e 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -676,13 +676,23 @@ class RSSFeedsPlugin < Plugin
end
def rewatch_rss(m=nil, params=nil)
- stop_watches
+ if params and handle = params[:handle]
+ feed = @feeds.fetch(handle.downcase, nil)
+ if feed
+ @bot.timer.reschedule(@watch[feed.handle], 0)
+ m.okay if m
+ else
+ m.reply _("no such feed %{handle}") % { :handle => handle } if m
+ end
+ else
+ stop_watches
- # Read watches from list.
- watchlist.each{ |handle, feed|
- watchRss(feed, m)
- }
- m.okay if m
+ # Read watches from list.
+ watchlist.each{ |handle, feed|
+ watchRss(feed, m)
+ }
+ m.okay if m
+ end
end
private
@@ -1057,5 +1067,5 @@ plugin.map 'rss unwatch :handle [in :chan]',
:action => 'unwatch_rss'
plugin.map 'rss rmwatch :handle [in :chan]',
:action => 'unwatch_rss'
-plugin.map 'rss rewatch',
+plugin.map 'rss rewatch [:handle]',
:action => 'rewatch_rss'