Support NOTICE without a prefix ("NOTICE AUTH" etc)
This commit is contained in:
parent
89f928327b
commit
14a8c2dab4
1 changed files with 8 additions and 3 deletions
|
@ -411,17 +411,22 @@ class LineHandler(object):
|
||||||
|
|
||||||
# we've received a notice
|
# we've received a notice
|
||||||
def notice(self, event):
|
def notice(self, event):
|
||||||
nickname, username, hostname = Utils.seperate_hostmask(
|
|
||||||
event["prefix"])
|
|
||||||
message = event["arbitrary"] or ""
|
message = event["arbitrary"] or ""
|
||||||
message_split = message.split(" ")
|
message_split = message.split(" ")
|
||||||
target = event["args"][0]
|
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(
|
self.events.on("received.server-notice").call(
|
||||||
message=message, message_split=message_split,
|
message=message, message_split=message_split,
|
||||||
server=event["server"])
|
server=event["server"])
|
||||||
else:
|
else:
|
||||||
|
nickname, username, hostname = Utils.seperate_hostmask(sender)
|
||||||
user = event["server"].get_user(nickname)
|
user = event["server"].get_user(nickname)
|
||||||
|
|
||||||
if target[0] in event["server"].channel_types:
|
if target[0] in event["server"].channel_types:
|
||||||
channel = event["server"].get_channel(target)
|
channel = event["server"].get_channel(target)
|
||||||
self.events.on("received.notice.channel").call(
|
self.events.on("received.notice.channel").call(
|
||||||
|
|
Loading…
Reference in a new issue