From cb83db4c1c61569639b57cb627a8ef946f69fc6f Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 17 Sep 2015 19:24:38 -0700 Subject: [PATCH] relay: don't allow creating a channel that's already part of a relay --- plugins/relay.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/relay.py b/plugins/relay.py index 804e196..b196605 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -808,6 +808,10 @@ def create(irc, source, args): if not utils.isOper(irc, source): utils.msg(irc, source, 'Error: You must be opered in order to complete this operation.') 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()} initializeChannel(irc, channel) utils.msg(irc, source, 'Done.')