mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Correct our ValidChannel checking (no , in channel key) and provide a little
more information in supybot-wizard if there's an error when adding channels.
This commit is contained in:
parent
b196d3fc21
commit
c5db149f65
@ -383,7 +383,8 @@ def main():
|
||||
# FIXME: say which ones weren't channels.
|
||||
output("""Not all of those are valid IRC channels. Be sure to
|
||||
prefix the channel with # (or +, or !, or &, but no one uses
|
||||
those channels, really).""")
|
||||
those channels, really). Be sure the channel key (if you are
|
||||
supplying one) does not contain a comma.""")
|
||||
else:
|
||||
conf.supybot.channels.setValue([])
|
||||
|
||||
|
@ -168,7 +168,13 @@ class ValidChannel(registry.String):
|
||||
"""Value must be a valid IRC channel name."""
|
||||
def setValue(self, v):
|
||||
if ',' in v:
|
||||
(channel, _) = v.split(',', 1)
|
||||
# To prevent stupid users from: a) trying to add a channel key
|
||||
# with a comma in it, b) trying to add channels separated by
|
||||
# commas instead of spaces
|
||||
try:
|
||||
(channel, _) = v.split(',')
|
||||
except ValueError:
|
||||
self.error()
|
||||
else:
|
||||
channel = v
|
||||
if not ircutils.isChannel(channel):
|
||||
|
Loading…
Reference in New Issue
Block a user