preprocess.send.* event don't have IRCChannel objects on them
This commit is contained in:
parent
c2eb96882a
commit
2dc290951a
1 changed files with 6 additions and 2 deletions
|
@ -10,8 +10,12 @@ class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("preprocess.send.privmsg")
|
@utils.hook("preprocess.send.privmsg")
|
||||||
@utils.hook("preprocess.send.notice")
|
@utils.hook("preprocess.send.notice")
|
||||||
def preprocess(self, event):
|
def preprocess(self, event):
|
||||||
strip_color = event["channel"].get_setting("strip-color",
|
strip_color = event["server"].get_setting("strip-color", False)
|
||||||
event["server"].get_setting("strip-color", False))
|
target = event["line"].args[0]
|
||||||
|
if not strip_color and target in event["server"].channels:
|
||||||
|
channel = event["server"].channels.get(target)
|
||||||
|
strip_color = channel.get_setting("strip-color", False)
|
||||||
|
|
||||||
if strip_color:
|
if strip_color:
|
||||||
message = event["line"].args.get(-1)
|
message = event["line"].args.get(-1)
|
||||||
if not message == None:
|
if not message == None:
|
||||||
|
|
Loading…
Reference in a new issue