From b7ba76cc13d4ff2256892a0ca8f2767e26aa9844 Mon Sep 17 00:00:00 2001 From: Clay Date: Thu, 3 Dec 2026 14:35:56 -0500 Subject: [PATCH] Buddy status: only online/offline dots --- public/index.html | 4 ++-- public/js/ui.js | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/public/index.html b/public/index.html index 90f04f4..1ba6f5d 100644 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,7 @@ Web OSCAR Chat - +
@@ -98,6 +98,6 @@
- + diff --git a/public/js/ui.js b/public/js/ui.js index daf19d8..4c84641 100644 --- a/public/js/ui.js +++ b/public/js/ui.js @@ -148,14 +148,12 @@ export function renderUserResults(users, onOpen) { function buddyStatus(b) { const raw = String(b?.state || b?.status || '').toLowerCase(); - if (['online', 'present', 'active'].includes(raw)) return 'online'; - if (['away', 'idle', 'dnd', 'busy', 'na'].includes(raw) || Number(b?.idleMins) > 0) return 'away'; if (['offline', 'disconnected'].includes(raw)) return 'offline'; + if (['online', 'present', 'active', 'away', 'idle', 'dnd', 'busy', 'na'].includes(raw)) return 'online'; if (b?.online === true || b?.online === 'true' || b?.online === 1) return 'online'; if (b?.online === false || b?.online === 'false' || b?.online === 0) return 'offline'; - // If we have an object but no explicit state, default to offline/unknown. - if (b && typeof b === 'object' && !raw) return 'offline'; - return raw ? 'away' : 'offline'; + // Only online/offline supported; unknown defaults to offline. + return 'offline'; } export function renderBuddies(buddies, onOpen) { @@ -167,8 +165,7 @@ export function renderBuddies(buddies, onOpen) { ? b : (b.aimId || b.displayId || b.screenName || b.name || JSON.stringify(b)); const status = typeof b === 'string' ? 'offline' : buddyStatus(b); - const statusMsg = b?.statusMsg || b?.awayMsg || b?.statusMessage || ''; - const title = statusMsg ? `${status}: ${statusMsg}` : status; + const title = status === 'online' ? 'Online' : 'Offline'; const btn = document.createElement('button'); btn.type = 'button';