mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-25 01:40:38 +01:00
classes: add an is_channel argument to _parse_modes
This is required for the following commit.
This commit is contained in:
parent
1413aa6042
commit
f12318b5dc
@ -558,7 +558,7 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
|
|||||||
# Band-aid patch here to prevent bad bans set by Janus forwarding people into invalid channels.
|
# Band-aid patch here to prevent bad bans set by Janus forwarding people into invalid channels.
|
||||||
return bool(cls._HOSTMASK_RE.match(text) and '#' not in text)
|
return bool(cls._HOSTMASK_RE.match(text) and '#' not in text)
|
||||||
|
|
||||||
def _parse_modes(self, args, existing, supported_modes, prefixmodes=None):
|
def _parse_modes(self, args, existing, supported_modes, is_channel=False, prefixmodes=None):
|
||||||
"""
|
"""
|
||||||
parse_modes() core.
|
parse_modes() core.
|
||||||
|
|
||||||
@ -646,7 +646,8 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
|
|||||||
# C = Mode that changes a setting and only has a parameter when set.
|
# C = Mode that changes a setting and only has a parameter when set.
|
||||||
# D = Mode that changes a setting and never has a parameter.
|
# D = Mode that changes a setting and never has a parameter.
|
||||||
|
|
||||||
if not self.is_channel(target):
|
is_channel = self.is_channel(target)
|
||||||
|
if not is_channel:
|
||||||
log.debug('(%s) Using self.umodes for this query: %s', self.name, self.umodes)
|
log.debug('(%s) Using self.umodes for this query: %s', self.name, self.umodes)
|
||||||
|
|
||||||
if target not in self.users:
|
if target not in self.users:
|
||||||
@ -663,7 +664,8 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
|
|||||||
oldmodes = self._channels[target].modes
|
oldmodes = self._channels[target].modes
|
||||||
prefixmodes = self.prefixmodes
|
prefixmodes = self.prefixmodes
|
||||||
|
|
||||||
return self._parse_modes(args, oldmodes, supported_modes, prefixmodes=prefixmodes)
|
return self._parse_modes(args, oldmodes, supported_modes, is_channel=is_channel,
|
||||||
|
prefixmodes=prefixmodes)
|
||||||
|
|
||||||
def _apply_modes(self, old_modelist, changedmodes, is_channel=False,
|
def _apply_modes(self, old_modelist, changedmodes, is_channel=False,
|
||||||
prefixmodes=None):
|
prefixmodes=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user