diff options
| author | 2019-09-24 15:25:33 +0100 | |
|---|---|---|
| committer | 2019-09-24 15:25:33 +0100 | |
| commit | 5b82193f3be8d29edc36dddb7f78659def0c3038 (patch) | |
| tree | 15fc1c8f21235bbb686babcc9aa3b3dbbbab865c /modules | |
| parent | .lstrip("-") from unset setting name (diff) | |
| signature | ||
support $a (account) in ban-mask setting
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/channel_op.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/channel_op.py b/modules/channel_op.py index 40f7891a..ff200d61 100644 --- a/modules/channel_op.py +++ b/modules/channel_op.py @@ -11,7 +11,7 @@ KICK_REASON_SETTING = utils.Setting("default-kick-reason", "Set the default kick reason", example="have a nice trip") @utils.export("channelset", utils.Setting("ban-format", - "Set ban format ($n = nick, $u = username, $h = hostname)", + "Set ban format ($n = nick, $u = username, $h = hostname, $a = account)", example="*!$u@$h")) @utils.export("serverset", utils.OptionsSetting( ["qmode", "insp", "unreal", "none"], "mute-method", @@ -56,8 +56,10 @@ class Module(ModuleManager.BaseModule): event["args_split"][1:]) def _format_hostmask(self, user, s): - return s.replace("$n", user.nickname).replace("$u", user.username - ).replace("$h", user.hostname) + return (s.replace("$n", user.nickname) + .replace("$u", user.username) + .replace("$h", user.hostname) + .replace("$a", user.get_identified_account())) def _get_hostmask(self, channel, user): format = channel.get_setting("ban-format", "*!$u@$h") hostmask_split = [ |
