3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-27 05:03:07 +01:00

reverse_modes: ignore unsetting simple modes that didn't exist

This commit is contained in:
James Lu 2019-08-26 14:46:17 -07:00
parent b685f416f6
commit c2b5966739

View File

@ -1148,6 +1148,7 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
# If the query is a string, we have to parse it first. # If the query is a string, we have to parse it first.
if origstring: if origstring:
modes = self.parse_modes(target, modes.split(" ")) modes = self.parse_modes(target, modes.split(" "))
# Get the current mode list first. # Get the current mode list first.
if self.is_channel(target): if self.is_channel(target):
c = oldobj or self._channels[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 " log.debug("(%s) reverse_modes: skipping reversing '%s %s' with %s since it "
"wasn't previously set.", self.name, char, arg, mpair) "wasn't previously set.", self.name, char, arg, mpair)
continue 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) newmodes.append(mpair)
log.debug('(%s) reverse_modes: new modes: %s', self.name, newmodes) log.debug('(%s) reverse_modes: new modes: %s', self.name, newmodes)