From 345a473ee06b5eb15b4b72cee593baa0a000fb8d Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Sat, 22 Sep 2018 21:34:44 +0200 Subject: [PATCH] `ActiveStatus` model --- fbchat/models.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/fbchat/models.py b/fbchat/models.py index cb4f678..019aa8e 100644 --- a/fbchat/models.py +++ b/fbchat/models.py @@ -520,6 +520,25 @@ class Plan(object): def __unicode__(self): return ''.format(self.uid, repr(self.title), self.time, repr(self.location), repr(self.location_id)) +class ActiveStatus(object): + #: Whether the user is active now + active = None + #: Timestamp when the user was last active + last_active = None + #: Whether the user is playing Messenger game now + in_game = None + + def __init__(self, active=None, last_active=None, in_game=None): + self.active = active + self.last_active = last_active + self.in_game = in_game + + def __repr__(self): + return self.__unicode__() + + def __unicode__(self): + return ''.format(self.active, self.last_active, self.in_game) + class Enum(enum.Enum): """Used internally by fbchat to support enumerations""" def __repr__(self):