From c5a7978c9b3f2e024f0b2735baa5605c0f744e6d Mon Sep 17 00:00:00 2001 From: jesopo Date: Sat, 29 Sep 2018 10:51:16 +0100 Subject: [PATCH] Make 'account' arg for identify command optional --- modules/permissions.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/permissions.py b/modules/permissions.py index bc8a6eca..dde6b441 100644 --- a/modules/permissions.py +++ b/modules/permissions.py @@ -38,8 +38,8 @@ class Module(ModuleManager.BaseModule): user.identified_account_override = None user.identified_account_id_override = None - @Utils.hook("received.command.identify", private_only=True, min_args=2, - usage=" ") + @Utils.hook("received.command.identify", private_only=True, min_args=1, + usage="[account] ") def identify(self, event): """ Identify yourself @@ -57,8 +57,13 @@ class Module(ModuleManager.BaseModule): return if not event["user"].identified_account_override: - account = event["args_split"][0] - password = " ".join(event["args_split"][1:]) + if len(event["args_split"]) > 1: + account = event["args_split"][0] + password = " ".join(event["args_split"][1:]) + else: + account = event["user"].nickname + password = event["args"] + hash, salt = self._get_hash(event["server"], account) if hash and salt: attempt, _ = self._make_hash(password, salt)