Check server presence support and comment code

This commit is contained in:
vslg
2020-07-02 21:25:24 -03:00
committed by miruka
parent d5e0a3340d
commit 91ed600997
6 changed files with 27 additions and 3 deletions

View File

@@ -61,6 +61,10 @@ class Presence():
def update_members(self):
for member in self.members.values():
# Do not update if member is changing to invisible
# Because when setting invisible presence will give us presence
# event telling us we are offline, we do not want to set member
# presence to offline.
if (
member.presence == self.State.invisible
) and (
@@ -90,6 +94,9 @@ class Account(ModelItem):
local_unreads: bool = False
local_highlights: bool = False
# For some reason, Account cannot inherit Presence, because QML keeps
# complaining type error on unknown file
presence_support: bool = False
presence: Presence.State = Presence.State.offline
currently_active: bool = False
last_active_ago: int = -1