Support TAGMSG in IRCLineHandler
This commit is contained in:
parent
c0130a34eb
commit
5963308bdc
1 changed files with 16 additions and 0 deletions
|
@ -42,6 +42,7 @@ class LineHandler(object):
|
||||||
events.on("raw").on("NOTICE").hook(self.notice)
|
events.on("raw").on("NOTICE").hook(self.notice)
|
||||||
events.on("raw").on("CHGHOST").hook(self.chghost)
|
events.on("raw").on("CHGHOST").hook(self.chghost)
|
||||||
events.on("raw").on("ACCOUNT").hook(self.account)
|
events.on("raw").on("ACCOUNT").hook(self.account)
|
||||||
|
events.on("raw").on("TAGMSG").hook(self.account)
|
||||||
|
|
||||||
events.on("raw").on("CAP").hook(self.cap)
|
events.on("raw").on("CAP").hook(self.cap)
|
||||||
events.on("raw").on("authenticate").hook(self.authenticate)
|
events.on("raw").on("authenticate").hook(self.authenticate)
|
||||||
|
@ -402,6 +403,21 @@ class LineHandler(object):
|
||||||
message=message, message_split=message_split,
|
message=message, message_split=message_split,
|
||||||
user=user, server=event["server"])
|
user=user, server=event["server"])
|
||||||
|
|
||||||
|
# IRCv3 TAGMSG, used to send tags without any other information
|
||||||
|
def tagmsg(self, event):
|
||||||
|
nickname, username, hostname = Utils.seperate_hostmask(
|
||||||
|
event["prefix"])
|
||||||
|
user = event["channel"].get_user(nickname)
|
||||||
|
target = event["args"][0]
|
||||||
|
|
||||||
|
if target[0] in event["server"].channel_types:
|
||||||
|
channel = event["server"].get_channel(target)
|
||||||
|
self.events.on("received.tagmsg.channel").call(channel=channel,
|
||||||
|
user=user, tags=event["tags"], server=server)
|
||||||
|
elif event["server"].is_own_nickname(target):
|
||||||
|
self.events.on("received.tagmsg.private").call(
|
||||||
|
user=user, tags=event["tags"], server=server)
|
||||||
|
|
||||||
# a user's username and/or hostname has changed
|
# a user's username and/or hostname has changed
|
||||||
def chghost(self, event):
|
def chghost(self, event):
|
||||||
nickname, username, hostname = Utils.seperate_hostmask(
|
nickname, username, hostname = Utils.seperate_hostmask(
|
||||||
|
|
Loading…
Reference in a new issue