Ensure a stable per-device fingerprint id (random) stored in a cookie. This is *not* hardware fingerprinting; it's a per-browser random id.
(resp=None)
| 1376 | nick = u |
| 1377 | try: |
| 1378 | if r["nickname_enc"]: |
| 1379 | nick = aesgcm_decrypt_text(r["nickname_enc"]) or u |
| 1380 | except Exception: |
| 1381 | nick = u |
| 1382 | pic_path = r["pic_path"] |
| 1383 | has_pic = bool(pic_path and os.path.exists(pic_path)) |
| 1384 | on = is_online(u, scope) |
| 1385 | cards.append({"username": u, "nickname": nick, "has_pic": has_pic, "online": on}) |
| 1386 | |
| 1387 | # Sort: online first, then nickname/username |
| 1388 | cards.sort(key=lambda c: (0 if c["online"] else 1, str(c["nickname"]).lower(), c["username"].lower())) |
| 1389 | |
| 1390 | online_count = sum(1 for c in cards if c["online"]) |
| 1391 | offline_count = len(cards) - online_count |
no outgoing calls
no test coverage detected