3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

relay: don't allow creating a channel that's already part of a relay

This commit is contained in:
James Lu 2015-09-17 19:24:38 -07:00
parent 8faf86aa8f
commit cb83db4c1c

View File

@ -808,6 +808,10 @@ def create(irc, source, args):
if not utils.isOper(irc, source): if not utils.isOper(irc, source):
utils.msg(irc, source, 'Error: You must be opered in order to complete this operation.') utils.msg(irc, source, 'Error: You must be opered in order to complete this operation.')
return return
localentry = findRelay((irc.name, channel))
if localentry:
utils.msg(irc, source, 'Error: Channel %r is already part of a relay.' % channel)
return
db[(irc.name, channel)] = {'claim': [irc.name], 'links': set(), 'blocked_nets': set()} db[(irc.name, channel)] = {'claim': [irc.name], 'links': set(), 'blocked_nets': set()}
initializeChannel(irc, channel) initializeChannel(irc, channel)
utils.msg(irc, source, 'Done.') utils.msg(irc, source, 'Done.')