From 14a8c2dab4c5dffd17878523d10f532cba4c24cd Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 6 Sep 2018 11:41:32 +0100 Subject: [PATCH] Support NOTICE without a prefix ("NOTICE AUTH" etc) --- IRCLineHandler.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/IRCLineHandler.py b/IRCLineHandler.py index ed7e1709..b3a7ee1c 100644 --- a/IRCLineHandler.py +++ b/IRCLineHandler.py @@ -411,17 +411,22 @@ class LineHandler(object): # we've received a notice def notice(self, event): - nickname, username, hostname = Utils.seperate_hostmask( - event["prefix"]) message = event["arbitrary"] or "" message_split = message.split(" ") target = event["args"][0] - if nickname == event["server"].name or target == "*": + sender = Utils.remove_colon(event["prefix"] or "") + + if sender == event["server"].name or target == "*" or not event[ + "prefix"]: + event["server"].name = Utils.remove_colon(event["prefix"]) + self.events.on("received.server-notice").call( message=message, message_split=message_split, server=event["server"]) else: + nickname, username, hostname = Utils.seperate_hostmask(sender) user = event["server"].get_user(nickname) + if target[0] in event["server"].channel_types: channel = event["server"].get_channel(target) self.events.on("received.notice.channel").call(