From 7549c0f998b4dfc01fbfc4035393719dd15afcd5 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 24 Sep 2019 15:27:35 +0100 Subject: support "$$" as "$" in ban-format --- modules/channel_op.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/channel_op.py b/modules/channel_op.py index ff200d61..3149d9b5 100644 --- a/modules/channel_op.py +++ b/modules/channel_op.py @@ -56,10 +56,13 @@ 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) - .replace("$a", user.get_identified_account())) + mask_split = s.split("$$") + for i, mask_part in enumerate(mask_split): + mask_split[i] = (s.replace("$n", user.nickname) + .replace("$u", user.username) + .replace("$h", user.hostname) + .replace("$a", user.get_identified_account())) + return "$".join(mask_split) def _get_hostmask(self, channel, user): format = channel.get_setting("ban-format", "*!$u@$h") hostmask_split = [ -- cgit v1.3.1-10-gc9f91