aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-24 15:27:35 +0100
committerGravatar jesopo2019-09-24 15:27:35 +0100
commit7549c0f998b4dfc01fbfc4035393719dd15afcd5 (patch)
tree7202177bbba10ce7cdb4fab396edb2c88b35dd82
parentsupport $a (account) in ban-mask setting (diff)
signature
support "$$" as "$" in ban-format
-rw-r--r--modules/channel_op.py11
1 files changed, 7 insertions, 4 deletions
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 = [