34
34
MAX_MESSAGE_LENGTH ,
35
35
MAX_STREAM_NAME_LENGTH ,
36
36
MAX_TOPIC_NAME_LENGTH ,
37
+ PRESENCE_OFFLINE_THRESHOLD_SECS ,
38
+ PRESENCE_PING_INTERVAL_SECS ,
37
39
TYPING_STARTED_EXPIRY_PERIOD ,
38
40
TYPING_STARTED_WAIT_PERIOD ,
39
41
TYPING_STOPPED_WAIT_PERIOD ,
81
83
from zulipterminal .ui_tools .utils import create_msg_box_list
82
84
83
85
84
- OFFLINE_THRESHOLD_SECS = 140
85
-
86
-
87
86
class ServerConnectionFailure (Exception ):
88
87
pass
89
88
@@ -445,7 +444,7 @@ def _start_presence_updates(self) -> None:
445
444
view = self .controller .view
446
445
view .users_view .update_user_list (user_list = self .users )
447
446
view .middle_column .update_message_list_status_markers ()
448
- time .sleep (60 )
447
+ time .sleep (PRESENCE_PING_INTERVAL_SECS )
449
448
450
449
@asynch
451
450
def toggle_message_reaction (
@@ -1202,7 +1201,7 @@ def _update_users_data_from_initial_data(self) -> None:
1202
1201
*
1203
1202
* Out of the ClientPresence objects found in `presence`, we
1204
1203
* consider only those with a timestamp newer than
1205
- * OFFLINE_THRESHOLD_SECS ; then of
1204
+ * PRESENCE_OFFLINE_THRESHOLD_SECS ; then of
1206
1205
* those, return the one that has the greatest UserStatus, where
1207
1206
* `active` > `idle` > `offline`.
1208
1207
*
@@ -1216,7 +1215,7 @@ def _update_users_data_from_initial_data(self) -> None:
1216
1215
timestamp = client [1 ]["timestamp" ]
1217
1216
if client_name == "aggregated" :
1218
1217
continue
1219
- elif (time .time () - timestamp ) < OFFLINE_THRESHOLD_SECS :
1218
+ elif (time .time () - timestamp ) < PRESENCE_OFFLINE_THRESHOLD_SECS :
1220
1219
if status == "active" :
1221
1220
aggregate_status = "active"
1222
1221
if status == "idle" and aggregate_status != "active" :
0 commit comments