From 97bb044640da8463e698f7c3015309a3a57a10c9 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Fri, 27 Nov 2020 16:25:22 +0000 Subject: [PATCH] fix atheme2json to handle mlock mode removal For example, if the mlock is set to `-i`, `i` is not present in the `modes` and thus it would error. I'm inclined to think that the negative mlock feature doesn't behave correctly, because the mlock of `-i` (or `-n`) would prevent anyone from ever setting those modes on the channel. Which this does not appear to be the case. Fixes #1401 --- distrib/atheme/atheme2json.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/distrib/atheme/atheme2json.py b/distrib/atheme/atheme2json.py index b96141fd..3bffcc1c 100644 --- a/distrib/atheme/atheme2json.py +++ b/distrib/atheme/atheme2json.py @@ -65,8 +65,7 @@ def convert(infile): for flag, mode in CMODE_FLAG_TO_MODE.items(): if flag & mlock_on != 0: modes.add(mode) - for flag, mode in CMODE_FLAG_TO_MODE.items(): - if flag & mlock_off != 0: + elif flag & mlock_off != 0 and mode in modes: modes.remove(mode) chdata['modes'] = ''.join(modes) chdata['limit'] = int(parts[7])