Track a user's away status in IRCUser
This commit is contained in:
parent
be39669580
commit
0d863a4239
2 changed files with 3 additions and 0 deletions
|
@ -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"])
|
||||||
|
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue