|
@@ -2,10 +2,13 @@
|
|
|
|
|
|
from telnetlib import Telnet
|
|
|
from collections import defaultdict
|
|
|
+from datetime import timedelta
|
|
|
|
|
|
import toml
|
|
|
from flask import Flask, jsonify, render_template_string
|
|
|
|
|
|
+IDLE_TIMEOUT = timedelta(minutes=5)
|
|
|
+
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
@@ -92,6 +95,11 @@ def get_users():
|
|
|
audio_status.append("Sound muted")
|
|
|
if len(audio_status) > 0:
|
|
|
user_text += f" ({', '.join(audio_status)})"
|
|
|
+ idle = timedelta(milliseconds=int(info["client_info"].get("client_idle_time", "0")))
|
|
|
+ if idle >= IDLE_TIMEOUT:
|
|
|
+ # strip out the sub-second resolution
|
|
|
+ idle -= timedelta(microseconds=idle.microseconds)
|
|
|
+ user_text += f" (Idle for {idle})"
|
|
|
users.append(user_text)
|
|
|
channel_users[channels[info["cid"]]].append(user_text)
|
|
|
|