aboutsummaryrefslogtreecommitdiff
path: root/modules/line_handler.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-02-12 17:07:39 +0000
committerGravatar jesopo2019-02-12 17:07:39 +0000
commit2e925a685359c3a99d3794ff1d43dfbf2c1cf319 (patch)
treef104858c3149132d826317dc8d0ae6ddfcfb15f8 /modules/line_handler.py
parent`user` is null when we're sending a message non-echo-mesasge (line_handler.py) (diff)
signature
`user` is null when we sent a NOTICE non-echo-message (line_handler.py)
Diffstat (limited to 'modules/line_handler.py')
-rw-r--r--modules/line_handler.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/line_handler.py b/modules/line_handler.py
index 351c786d..da69888d 100644
--- a/modules/line_handler.py
+++ b/modules/line_handler.py
@@ -544,22 +544,27 @@ class Module(ModuleManager.BaseModule):
context = "channel" if channel else "private"
hook = self.events.on(direction).on("notice").on(context)
+ user_nickname = None
+ if user:
+ user_nickname = None if from_self else user.nickname
+
kwargs = {"message": message, "message_split": message_split,
"server": event["server"], "tags": event["tags"]}
if channel:
hook.call(user=user, channel=channel, **kwargs)
- channel.buffer.add_notice(user.nickname, message, event["tags"],
+ channel.buffer.add_notice(user_nickname, message, event["tags"],
user==None)
elif event["server"].is_own_nickname(target):
hook.call(user=user, **kwargs)
- user.buffer.add_notice(user.nickname, message, event["tags"],
+ user.buffer.add_notice(user_nickname, message, event["tags"],
False)
elif not "prefix" in event:
# a notice we've sent to a user
user = event["server"].get_user(target)
hook.call(user=user, **kwargs)
- user.buffer.add_message(None, message, event["tags"], True)
+ user.buffer.add_notice(user_nickname, message, event["tags"],
+ True)
# IRCv3 TAGMSG, used to send tags without any other information
@utils.hook("raw.received.tagmsg")