diff options
| author | 2018-09-29 10:51:16 +0100 | |
|---|---|---|
| committer | 2018-09-29 10:51:16 +0100 | |
| commit | c5a7978c9b3f2e024f0b2735baa5605c0f744e6d (patch) | |
| tree | bc86898e2f028da40364cba06d5afbc8ee87c62f | |
| parent | Better .strip()/.split() logic for !help (diff) | |
| signature | ||
Make 'account' arg for identify command optional
| -rw-r--r-- | modules/permissions.py | 13 |
1 files 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="<account> <password>") + @Utils.hook("received.command.identify", private_only=True, min_args=1, + usage="[account] <password>") 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) |
