LinkRelay: disallow nesting for list & nicks cmds

also: made a note that nicksToIgnore.nicks takes a space seperated list!
This commit is contained in:
GLolol 2013-10-27 12:38:52 -07:00
parent bab29cfe7f
commit 20f7a93170
2 changed files with 6 additions and 2 deletions

View File

@ -81,7 +81,7 @@ conf.registerChannelValue(LinkRelay, 'includeNetwork',
conf.registerGroup(LinkRelay, 'nickstoIgnore')
conf.registerChannelValue(LinkRelay.nickstoIgnore, 'nicks',
registry.SpaceSeparatedListOfStrings('', _("""Determines a list of nicks for the bot to
ignore.""")))
ignore (takes a space-seperated list).""")))
conf.registerChannelValue(LinkRelay.nickstoIgnore, 'affectPrivmsgs',
registry.Boolean(True, _("""Determines whether the bot will ignore PRIVMSGs
from the nicks listed in nicksToIgnore. If set to False, the bot will only

View File

@ -160,7 +160,9 @@ class LinkRelay(callbacks.Plugin):
"""takes no arguments
Returns all the defined relay links"""
if not self.relays:
if irc.nested:
irc.error('This command cannot be nested.', Raise=True)
elif not self.relays:
irc.reply(_('This is no relay enabled. Use "linkrelay add" to '
'add one.'))
return
@ -378,6 +380,8 @@ class LinkRelay(callbacks.Plugin):
Returns the nicks of the people in the linked channels.
<channel> is only necessary if the message
isn't sent on the channel itself."""
if irc.nested:
irc.error('This command cannot be nested.', Raise=True)
for relay in self.relays:
if relay.sourceChannel == channel and \
relay.sourceNetwork == irc.network: