From ebd5b77576cf552c366c88773f4974b8528442a2 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 9 Mar 2017 20:36:54 -0800 Subject: [PATCH] relay: normalize channel case in 'link' (regression from commit 93c9b6289c50ebc89043c866d06eb0d360ea6102) Reported by @koaxirc. --- plugins/relay.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/relay.py b/plugins/relay.py index 18abdd5..8af01ed 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -1707,10 +1707,12 @@ def link(irc, source, args): network is alive, and link the channel anyways.""" args = link_parser.parse_args(args) + # Normalize channel case + channel = irc.toLower(args.channel) localchan = irc.toLower(args.localchannel or args.channel) remotenet = args.remotenet - for c in (args.channel, localchan): + for c in (channel, localchan): if not utils.isChannel(c): irc.error('Invalid channel %r.' % c) return @@ -1750,7 +1752,7 @@ def link(irc, source, args): try: with db_lock: - entry = db[(remotenet, args.channel)] + entry = db[(remotenet, channel)] except KeyError: irc.error('No such relay %r exists.' % args.channel) return