Track a user's away status in IRCUser

This commit is contained in:
jesopo 2018-09-04 10:15:20 +01:00
parent be39669580
commit 0d863a4239
2 changed files with 3 additions and 0 deletions

View file

@ -449,9 +449,11 @@ class LineHandler(object):
user = event["server"].get_user(nickname) user = event["server"].get_user(nickname)
message = event["arbitrary"] message = event["arbitrary"]
if message: if message:
user.away = True
self.events.on("received.away.on").call(user=user, self.events.on("received.away.on").call(user=user,
server=event["server"], message=message) server=event["server"], message=message)
else: else:
user.away = False
self.events.on("received.away.off").call(user=user, self.events.on("received.away.off").call(user=user,
server=event["server"]) server=event["server"])

View file

@ -12,6 +12,7 @@ class User(object):
self.bot = bot self.bot = bot
self.channels = set([]) self.channels = set([])
self.identified_account = None self.identified_account = None
self.away = False
self.buffer = IRCBuffer.Buffer(bot) self.buffer = IRCBuffer.Buffer(bot)
def __repr__(self): def __repr__(self):