@@ -1061,22 +1061,25 @@ def get_all_users(self) -> List[Dict[str, Any]]:
1061
1061
* UserStatus, an arbitrary one is chosen.
1062
1062
"""
1063
1063
aggregate_status = "offline"
1064
+ server_aggregate_status = "offline"
1064
1065
for client_name , client_presence in presences [email ].items ():
1065
1066
status = client_presence ["status" ]
1066
1067
timestamp = client_presence ["timestamp" ]
1067
- if client_name == "aggregated" :
1068
- continue
1069
1068
if (server_timestamp - timestamp ) < OFFLINE_THRESHOLD_SECS :
1070
- if status == "active" :
1071
- aggregate_status = "active"
1072
- if status == "idle" and aggregate_status != "active" :
1073
- aggregate_status = status
1074
- if status == "offline" and (
1075
- aggregate_status != "active" and aggregate_status != "idle"
1076
- ):
1077
- aggregate_status = status
1078
-
1079
- status = aggregate_status
1069
+ if client_name == "aggregated" :
1070
+ server_aggregate_status = status
1071
+ else :
1072
+ if status == "active" :
1073
+ aggregate_status = "active"
1074
+ if status == "idle" and aggregate_status != "active" :
1075
+ aggregate_status = status
1076
+ if status == "offline" and (
1077
+ aggregate_status != "active"
1078
+ and aggregate_status != "idle"
1079
+ ):
1080
+ aggregate_status = status
1081
+
1082
+ status = server_aggregate_status
1080
1083
else :
1081
1084
# Set status of users not in the `presence` list
1082
1085
# as 'inactive'. They will not be displayed in the
0 commit comments