@@ -1231,24 +1231,27 @@ def _update_users_data_from_initial_data(self) -> None:
1231
1231
* UserStatus, an arbitrary one is chosen.
1232
1232
"""
1233
1233
aggregate_status : UserStatus = "offline"
1234
+ server_aggregate_status = "offline"
1234
1235
for client_name , client_presence in presences [email ].items ():
1235
1236
status = client_presence ["status" ]
1236
1237
timestamp = client_presence ["timestamp" ]
1237
- if client_name == "aggregated" :
1238
- continue
1239
1238
if (
1240
1239
server_timestamp - timestamp
1241
1240
) < self .server_presence_offline_threshold_secs :
1242
- if status == "active" :
1243
- aggregate_status = "active"
1244
- if status == "idle" and aggregate_status != "active" :
1245
- aggregate_status = status
1246
- if status == "offline" and (
1247
- aggregate_status != "active" and aggregate_status != "idle"
1248
- ):
1249
- aggregate_status = status
1250
-
1251
- status = aggregate_status
1241
+ if client_name == "aggregated" :
1242
+ server_aggregate_status = status
1243
+ else :
1244
+ if status == "active" :
1245
+ aggregate_status = "active"
1246
+ if status == "idle" and aggregate_status != "active" :
1247
+ aggregate_status = status
1248
+ if status == "offline" and (
1249
+ aggregate_status != "active"
1250
+ and aggregate_status != "idle"
1251
+ ):
1252
+ aggregate_status = status
1253
+
1254
+ status = server_aggregate_status
1252
1255
else :
1253
1256
# Set status of users not in the `presence` list
1254
1257
# as 'inactive'. They will not be displayed in the
0 commit comments