diff --git a/classes.py b/classes.py index c2a8c9f..eddbdeb 100644 --- a/classes.py +++ b/classes.py @@ -1148,6 +1148,7 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore): # If the query is a string, we have to parse it first. if origstring: modes = self.parse_modes(target, modes.split(" ")) + # Get the current mode list first. if self.is_channel(target): c = oldobj or self._channels[target] @@ -1210,6 +1211,11 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore): log.debug("(%s) reverse_modes: skipping reversing '%s %s' with %s since it " "wasn't previously set.", self.name, char, arg, mpair) continue + elif char[0] == '-' and mchar not in oldmodes_mapping: + # Check the same for regular modes that previously didn't exist + log.debug("(%s) reverse_modes: skipping reversing '%s %s' with %s since it " + "wasn't previously set.", self.name, char, arg, mpair) + continue newmodes.append(mpair) log.debug('(%s) reverse_modes: new modes: %s', self.name, newmodes)