aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-03-09 13:37:59 +0000
committerGravatar jesopo2019-03-09 13:37:59 +0000
commit2d949391a6aea44f1109310cf0ab0cf450c43247 (patch)
tree63ffb7a68596b35afc2aeb34eb2f05d319a7ed85 /modules
parentHandle negative (end-relative) indexes being given to IRCArgs.get (diff)
signature
Support setting strip-color per-channel not just per-server
Diffstat (limited to 'modules')
-rw-r--r--modules/strip_color.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/strip_color.py b/modules/strip_color.py
index c9c444b5..095683d3 100644
--- a/modules/strip_color.py
+++ b/modules/strip_color.py
@@ -3,11 +3,16 @@ from src import ModuleManager, utils
@utils.export("serverset", {"setting": "strip-color",
"help": "Set whether I strip colors from my messages on this server",
"validate": utils.bool_or_none})
+@utils.export("channelset", {"setting": "strip-color",
+ "help": "Set whether I strip colors from my messages on in this channel",
+ "validate": utils.bool_or_none})
class Module(ModuleManager.BaseModule):
@utils.hook("preprocess.send.privmsg")
@utils.hook("preprocess.send.notice")
def preprocess(self, event):
- if event["server"].get_setting("strip-color", False):
+ strip_color = event["channel"].get_setting("strip-color",
+ event["server"].get_setting("strip-color", False))
+ if strip_color:
message = event["line"].args.get(-1)
if not message == None:
event["line"].args[-1] = utils.irc.strip_font(message)