From ac16887c4819f9378d28922b825f1e492cdb7ea8 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 4 Feb 2019 21:32:44 +0000 Subject: Reply to statusmsg commands (e.g. '/msg +channel !ping') with the same statusmsg --- modules/line_handler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/line_handler.py') diff --git a/modules/line_handler.py b/modules/line_handler.py index da41a463..76d78bf7 100644 --- a/modules/line_handler.py +++ b/modules/line_handler.py @@ -413,8 +413,10 @@ class Module(ModuleManager.BaseModule): # strip prefix_symbols from the start of target, for when people use # e.g. 'PRIVMSG +#channel :hi' which would send a message to only # voiced-or-above users - prefix_symbols = "".join(event["server"].prefix_symbols.keys()) - target = target.lstrip(prefix_symbols) + statusmsg = [] + while target[0] in event["server"].prefix_symbols.keys(): + statusmsg.append(target[0]) + target = target[1:] channel = None if target[0] in event["server"].channel_types: @@ -445,7 +447,7 @@ class Module(ModuleManager.BaseModule): if channel: self._event(event, "message.channel", user=user, channel=channel, - **kwargs) + statusmsg=statusmsg, **kwargs) channel.buffer.add_message(user_nickname, message, action, event["tags"], user==None) elif event["server"].is_own_nickname(target): -- cgit v1.3.1-10-gc9f91