ScuttleBot
ui: filter agents from chat identity dropdown — operators only
Commit
954037bea92bcc20bb4804684f2cc4dcbd62d729cf7d41abc20e815b0964f67d
Parent
f5142030cbdeadb…
1 file changed
+2
-4
+2
-4
| --- internal/api/ui/index.html | ||
| +++ internal/api/ui/index.html | ||
| @@ -1919,16 +1919,14 @@ | ||
| 1919 | 1919 | return localStorage.getItem('sb_chat_nick') || ''; |
| 1920 | 1920 | } |
| 1921 | 1921 | function populateChatIdentity() { |
| 1922 | 1922 | const sel = document.getElementById('chat-identity'); |
| 1923 | 1923 | const current = getChatNick(); |
| 1924 | - // Operators + any registered nick can send (all types visible, operators first) | |
| 1924 | + // Only operators (human users) can chat — agents are not selectable. | |
| 1925 | 1925 | const operators = allAgents.filter(a => a.type === 'operator' && !a.revoked); |
| 1926 | - const bots = allAgents.filter(a => a.type !== 'operator' && !a.revoked); | |
| 1927 | - const options = [...operators, ...bots]; | |
| 1928 | 1926 | sel.innerHTML = '<option value="">— pick a user —</option>' + |
| 1929 | - options.map(a => `<option value="${esc(a.nick)}"${a.nick===current?' selected':''}>${esc(a.nick)} (${esc(a.type)})</option>`).join(''); | |
| 1927 | + operators.map(a => `<option value="${esc(a.nick)}"${a.nick===current?' selected':''}>${esc(a.nick)}</option>`).join(''); | |
| 1930 | 1928 | // Restore saved selection. |
| 1931 | 1929 | if (current) sel.value = current; |
| 1932 | 1930 | } |
| 1933 | 1931 | |
| 1934 | 1932 | function toggleChatLayout() { |
| 1935 | 1933 |
| --- internal/api/ui/index.html | |
| +++ internal/api/ui/index.html | |
| @@ -1919,16 +1919,14 @@ | |
| 1919 | return localStorage.getItem('sb_chat_nick') || ''; |
| 1920 | } |
| 1921 | function populateChatIdentity() { |
| 1922 | const sel = document.getElementById('chat-identity'); |
| 1923 | const current = getChatNick(); |
| 1924 | // Operators + any registered nick can send (all types visible, operators first) |
| 1925 | const operators = allAgents.filter(a => a.type === 'operator' && !a.revoked); |
| 1926 | const bots = allAgents.filter(a => a.type !== 'operator' && !a.revoked); |
| 1927 | const options = [...operators, ...bots]; |
| 1928 | sel.innerHTML = '<option value="">— pick a user —</option>' + |
| 1929 | options.map(a => `<option value="${esc(a.nick)}"${a.nick===current?' selected':''}>${esc(a.nick)} (${esc(a.type)})</option>`).join(''); |
| 1930 | // Restore saved selection. |
| 1931 | if (current) sel.value = current; |
| 1932 | } |
| 1933 | |
| 1934 | function toggleChatLayout() { |
| 1935 |
| --- internal/api/ui/index.html | |
| +++ internal/api/ui/index.html | |
| @@ -1919,16 +1919,14 @@ | |
| 1919 | return localStorage.getItem('sb_chat_nick') || ''; |
| 1920 | } |
| 1921 | function populateChatIdentity() { |
| 1922 | const sel = document.getElementById('chat-identity'); |
| 1923 | const current = getChatNick(); |
| 1924 | // Only operators (human users) can chat — agents are not selectable. |
| 1925 | const operators = allAgents.filter(a => a.type === 'operator' && !a.revoked); |
| 1926 | sel.innerHTML = '<option value="">— pick a user —</option>' + |
| 1927 | operators.map(a => `<option value="${esc(a.nick)}"${a.nick===current?' selected':''}>${esc(a.nick)}</option>`).join(''); |
| 1928 | // Restore saved selection. |
| 1929 | if (current) sel.value = current; |
| 1930 | } |
| 1931 | |
| 1932 | function toggleChatLayout() { |
| 1933 |