RSS: Add supybot.plugins.RSS.notice. Closes GH-1151.

This commit is contained in:
Valentin Lorentz 2015-09-23 11:27:20 +02:00
parent 1002ec5d30
commit 4498548cb3
2 changed files with 8 additions and 1 deletions

View File

@ -90,6 +90,9 @@ conf.registerGlobalValue(RSS, 'sortFeedItems',
FeedItemSortOrder('asInFeed', _("""Determines whether feed items should be
sorted by their publication/update timestamp or kept in the same order as
they appear in a feed.""")))
conf.registerChannelValue(RSS, 'notice',
registry.Boolean(False, _("""Determines whether announces will be sent
as notices instead of privmsgs.""")))
####################
# Headlines filtering

View File

@ -404,7 +404,11 @@ class RSS(callbacks.Plugin):
def announce_entry(self, irc, channel, feed, entry):
if self.should_send_entry(channel, entry):
s = self.format_entry(channel, feed, entry, True)
irc.queueMsg(ircmsgs.privmsg(channel, s))
if self.registryValue('notice', channel):
m = ircmsgs.notice(channel, s)
else:
m = ircmsgs.privmsg(channel, s)
irc.queueMsg(m)
##########