aboutsummaryrefslogtreecommitdiff
path: root/IRCLineHandler.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-03 12:31:00 +0100
committerGravatar jesopo2018-09-03 12:31:00 +0100
commitdea6fbce0f747f88a116c289f531dda9835e7377 (patch)
tree3ce83cd50cb3fa7913ba2e47b2c7b9d3626e0168 /IRCLineHandler.py
parentRemove channel from autojoin when BitBot parts it (diff)
signature
Support account-tag and account-notify
Diffstat (limited to 'IRCLineHandler.py')
-rw-r--r--IRCLineHandler.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/IRCLineHandler.py b/IRCLineHandler.py
index 429bced3..c8438c3f 100644
--- a/IRCLineHandler.py
+++ b/IRCLineHandler.py
@@ -7,7 +7,8 @@ RE_CHANMODES = re.compile(
RE_CHANTYPES = re.compile(r"\bCHANTYPES=(\W+)(?:\b|$)")
RE_MODES = re.compile(r"[-+]\w+")
-CAPABILITIES = {"message-tags", "multi-prefix", "chghost", "invite-notify"}
+CAPABILITIES = {"message-tags", "multi-prefix", "chghost", "invite-notify",
+ "account-tag", "account-notify"}
class LineHandler(object):
def __init__(self, bot, events):
@@ -40,6 +41,7 @@ class LineHandler(object):
events.on("raw").on("PRIVMSG").hook(self.privmsg)
events.on("raw").on("NOTICE").hook(self.notice)
events.on("raw").on("CHGHOST").hook(self.chghost)
+ events.on("raw").on("ACCOUNT").hook(self.account)
events.on("raw").on("CAP").hook(self.cap)
events.on("raw").on("authenticate").hook(self.authenticate)
@@ -400,6 +402,18 @@ class LineHandler(object):
user.username = username
user.hostname = hostname
+ def account(self, event):
+ nickname, username, hostname = Utils.seperate_hostmask(
+ event["prefix"])
+ user = event["server"].get_user("nickname")
+
+ if not event["args"][0] == "*":
+ self.events.on("received.account.login").call(user=user,
+ server=event["server"], account=account)
+ else:
+ self.events.on("received.account.logout").call(user=user,
+ server=event["server"])
+
# response to a WHO command for user information
def handle_352(self, event):
user = event["server"].get_user(event["args"][5])