mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-28 05:32:51 +01:00
classes, clientbot: don't allow _get_UID in parse_modes to create new users
This commit is contained in:
parent
da58669de5
commit
c1dbfdab48
@ -929,7 +929,7 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
|
||||
log.debug('Mode %s: This mode is a prefix mode.', mode)
|
||||
arg = args.pop(0)
|
||||
# Convert nicks to UIDs implicitly
|
||||
arg = self._get_UID(arg)
|
||||
arg = self._get_UID(arg) or arg
|
||||
if arg not in self.users: # Target doesn't exist, skip it.
|
||||
log.debug('(%s) Skipping setting mode "%s %s"; the '
|
||||
'target doesn\'t seem to exist!', self.name,
|
||||
|
@ -31,7 +31,7 @@ class ClientbotBaseProtocol(PyLinkNetworkCoreWithUtils):
|
||||
# Remove conf key checks for those not needed for Clientbot.
|
||||
self.conf_keys -= {'recvpass', 'sendpass', 'sid', 'sidrange', 'hostname'}
|
||||
|
||||
def _get_UID(self, nick, ident=None, host=None, spawn_new=True):
|
||||
def _get_UID(self, nick, ident=None, host=None, spawn_new=False):
|
||||
"""
|
||||
Fetches the UID for the given nick, creating one if it does not already exist and spawn_new is True.
|
||||
|
||||
@ -477,7 +477,7 @@ class ClientbotWrapperProtocol(ClientbotBaseProtocol, IRCCommonProtocol):
|
||||
except ValueError:
|
||||
ident = host = None # Set ident and host as null for now.
|
||||
nick = sender # Treat the sender prefix we received as a nick.
|
||||
idsource = self._get_UID(nick, ident, host)
|
||||
idsource = self._get_UID(nick, ident, host, spawn_new=True)
|
||||
|
||||
if idsource in self.users:
|
||||
# Handle IRCv3.2 account-tag.
|
||||
@ -719,7 +719,7 @@ class ClientbotWrapperProtocol(ClientbotBaseProtocol, IRCCommonProtocol):
|
||||
|
||||
# Get the PUID for the given nick. If one doesn't exist, spawn
|
||||
# a new virtual user.
|
||||
idsource = self._get_UID(nick, ident=ident, host=host)
|
||||
idsource = self._get_UID(nick, ident=ident, host=host, spawn_new=True)
|
||||
|
||||
# Queue these virtual users to be joined if they're not already in the channel,
|
||||
# or we're waiting for a kick acknowledgment for them.
|
||||
|
Loading…
Reference in New Issue
Block a user