Nachrichten klappen jetzt einigermassen
This commit is contained in:
1 parent
518248ca00
commit
ffdb399f9e
5 files changed
+551
-69
No files matched your search
@@ -648,11 +648,40 @@ dialog.group-streets-dialog.is-dragging article header {
|
||||
}
|
||||
|
||||
#chatModal article,
|
||||
.chat-dialog {
|
||||
.chat-dialog,
|
||||
#broadcastModal article,
|
||||
.broadcast-dialog {
|
||||
width: min(44rem, 94vw);
|
||||
max-width: 94vw;
|
||||
}
|
||||
|
||||
.chat-dialog > footer.chat-input-row {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.chat-input {
|
||||
flex: 1 1 0%;
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
height: 2.4rem;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.chat-send-button {
|
||||
flex: 0 0 2.4rem;
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border-radius: 0.55rem;
|
||||
font-size: 1rem;
|
||||
align-self: stretch;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.chat-messages {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -37,6 +37,12 @@ const dispatcherState = {
|
||||
streetById: new Map(),
|
||||
groups: [],
|
||||
groupById: new Map(),
|
||||
accounts: [],
|
||||
accountById: new Map(),
|
||||
lastCode0ReceivedAt: Date.now(),
|
||||
heartbeatTimeoutId: null,
|
||||
heartbeatWarningShown: false,
|
||||
groupMessageTargetId: null,
|
||||
polylinesByStreetId: new Map(),
|
||||
markersByGroupId: new Map(),
|
||||
browserLatLng: null,
|
||||
@@ -72,12 +78,14 @@ async function initDispatcher() {
|
||||
setInterval(updateClock, 1000);
|
||||
|
||||
try {
|
||||
const [streets, groups] = await Promise.all([
|
||||
const [streets, groups, accounts] = await Promise.all([
|
||||
fetchJson(`${apiBase}/init/streets`),
|
||||
fetchJson(`${apiBase}/init/groups`)
|
||||
fetchJson(`${apiBase}/init/groups`),
|
||||
fetchJson(`${apiBase}/init/accounts`).catch(() => [])
|
||||
]);
|
||||
dispatcherState.streets = Array.isArray(streets) ? streets : [];
|
||||
dispatcherState.groups = Array.isArray(groups) ? groups : [];
|
||||
dispatcherState.accounts = Array.isArray(accounts) ? accounts : [];
|
||||
indexData();
|
||||
buildPolylines();
|
||||
buildGroupAccordion();
|
||||
@@ -205,6 +213,12 @@ function indexData() {
|
||||
});
|
||||
|
||||
dispatcherState.groups.sort((a, b) => a.id - b.id);
|
||||
|
||||
dispatcherState.accountById.clear();
|
||||
dispatcherState.accounts.forEach(account => {
|
||||
account.id = Number(account.id);
|
||||
dispatcherState.accountById.set(account.id, account);
|
||||
});
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
@@ -772,6 +786,28 @@ function createGroupElement(group) {
|
||||
return details;
|
||||
}
|
||||
|
||||
function updateGroupLastMessagePreview(groupId) {
|
||||
const item = document.querySelector(`.group-item[data-group-id="${groupId}"]`);
|
||||
if (!item) return;
|
||||
const input = item.querySelector('.group-message');
|
||||
if (!input) return;
|
||||
const entries = dispatcherState.chatByGroup.get(Number(groupId)) || [];
|
||||
if (!entries.length) {
|
||||
input.value = '';
|
||||
input.placeholder = 'Noch keine Gruppennachricht';
|
||||
return;
|
||||
}
|
||||
const last = entries.slice().sort((a, b) => a.ts - b.ts).pop();
|
||||
if (!last) {
|
||||
input.value = '';
|
||||
input.placeholder = 'Noch keine Gruppennachricht';
|
||||
return;
|
||||
}
|
||||
input.placeholder = 'Chatverlauf öffnen';
|
||||
const preview = extractMessageText(last.text);
|
||||
input.value = `${getSenderDisplay(last.sender_id, last).name}: ${String(preview || '').replace(/\s+/g, ' ')}`;
|
||||
}
|
||||
|
||||
function refreshGroupControls(now = Date.now()) {
|
||||
dispatcherState.groups.forEach(group => {
|
||||
updateGroupMarkerOpacity(group, now);
|
||||
@@ -1040,6 +1076,46 @@ function handleMapClick(event) {
|
||||
cancelCrosshair();
|
||||
}
|
||||
|
||||
function startHeartbeatMonitoring() {
|
||||
if (dispatcherState.heartbeatTimeoutId) {
|
||||
clearTimeout(dispatcherState.heartbeatTimeoutId);
|
||||
}
|
||||
dispatcherState.heartbeatTimeoutId = setTimeout(checkHeartbeatTimeout, 95000);
|
||||
}
|
||||
|
||||
function checkHeartbeatTimeout() {
|
||||
const now = Date.now();
|
||||
if (dispatcherState.lastCode0ReceivedAt
|
||||
&& now - dispatcherState.lastCode0ReceivedAt > 90000) {
|
||||
setConnectionStatus('Nicht verbunden', 'disconnected');
|
||||
if (!dispatcherState.heartbeatWarningShown) {
|
||||
dispatcherState.heartbeatWarningShown = true;
|
||||
showHeartbeatWarning();
|
||||
}
|
||||
} else {
|
||||
dispatcherState.heartbeatWarningShown = false;
|
||||
}
|
||||
startHeartbeatMonitoring();
|
||||
}
|
||||
|
||||
function showHeartbeatWarning() {
|
||||
const dialog = document.getElementById('heartbeatWarningModal');
|
||||
if (!dialog) {
|
||||
alert('Keine Nachrichten mit Code 0 seit mehr als 90 Sekunden erhalten.');
|
||||
return;
|
||||
}
|
||||
if (typeof dialog.showModal === 'function') {
|
||||
dialog.showModal();
|
||||
} else {
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
function closeHeartbeatWarningModal() {
|
||||
const dialog = document.getElementById('heartbeatWarningModal');
|
||||
if (dialog && dialog.open) dialog.close();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Straßen einer Gruppe */
|
||||
/* ------------------------------------------------------------------ */
|
||||
@@ -1683,11 +1759,33 @@ function saveStreetState() {
|
||||
function openChat(groupId) {
|
||||
dispatcherState.chatGroupId = Number(groupId);
|
||||
renderChat();
|
||||
document.getElementById('chatModal').showModal();
|
||||
const dialog = document.getElementById('chatModal');
|
||||
if (dialog && typeof dialog.showModal === 'function') {
|
||||
dialog.showModal();
|
||||
} else if (dialog) {
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
function closeChatModal() {
|
||||
document.getElementById('chatModal').close();
|
||||
const dialog = document.getElementById('chatModal');
|
||||
if (dialog && dialog.open) dialog.close();
|
||||
}
|
||||
|
||||
function sendChatMessageFromModal() {
|
||||
const groupId = dispatcherState.chatGroupId;
|
||||
const group = groupId !== null ? dispatcherState.groupById.get(Number(groupId)) : null;
|
||||
const input = document.getElementById('chatInput');
|
||||
if (!group || !input) return;
|
||||
const text = String(input.value).trim();
|
||||
if (!text) return;
|
||||
sendWs({
|
||||
code: 1100,
|
||||
receiver_id: group.id,
|
||||
msg: JSON.stringify({group_id: group.id, text})
|
||||
});
|
||||
input.value = '';
|
||||
input.focus();
|
||||
}
|
||||
|
||||
function renderChat() {
|
||||
@@ -1706,48 +1804,99 @@ function renderChat() {
|
||||
empty.className = 'chat-empty';
|
||||
empty.textContent = 'Noch keine Nachrichten.';
|
||||
container.appendChild(empty);
|
||||
return;
|
||||
} else {
|
||||
entries
|
||||
.slice()
|
||||
.sort((a, b) => a.ts - b.ts)
|
||||
.forEach(entry => {
|
||||
const message = document.createElement('div');
|
||||
message.className = 'chat-message';
|
||||
const senderInfo = getSenderDisplay(entry.sender_id, entry);
|
||||
if (senderInfo.isMe) {
|
||||
message.classList.add('own');
|
||||
}
|
||||
|
||||
const header = document.createElement('div');
|
||||
header.className = 'chat-message-header';
|
||||
|
||||
const sender = document.createElement('span');
|
||||
sender.textContent = senderInfo.name;
|
||||
|
||||
const time = document.createElement('span');
|
||||
time.textContent = formatChatTime(entry.ts);
|
||||
|
||||
header.append(sender, time);
|
||||
|
||||
const text = document.createElement('div');
|
||||
text.className = 'chat-message-text';
|
||||
const textContent = extractMessageText(entry.text);
|
||||
text.textContent = textContent;
|
||||
|
||||
message.append(header, text);
|
||||
container.appendChild(message);
|
||||
});
|
||||
}
|
||||
|
||||
entries
|
||||
.slice()
|
||||
.sort((a, b) => a.ts - b.ts)
|
||||
.forEach(entry => {
|
||||
const message = document.createElement('div');
|
||||
message.className = 'chat-message';
|
||||
if (Number(entry.sender_id) === currentAccountId) {
|
||||
message.classList.add('own');
|
||||
}
|
||||
|
||||
const header = document.createElement('div');
|
||||
header.className = 'chat-message-header';
|
||||
|
||||
const sender = document.createElement('span');
|
||||
sender.textContent = senderLabel(entry.sender_id);
|
||||
|
||||
const time = document.createElement('span');
|
||||
time.textContent = formatChatTime(entry.ts);
|
||||
|
||||
header.append(sender, time);
|
||||
|
||||
const text = document.createElement('div');
|
||||
text.className = 'chat-message-text';
|
||||
text.textContent = entry.text;
|
||||
|
||||
message.append(header, text);
|
||||
container.appendChild(message);
|
||||
});
|
||||
|
||||
container.scrollTop = container.scrollHeight;
|
||||
}
|
||||
|
||||
function senderLabel(senderId) {
|
||||
const id = Number(senderId);
|
||||
if (id === currentAccountId) return 'Ich';
|
||||
function getSenderDisplay(senderId, messageOrPayload = null) {
|
||||
let payload = null;
|
||||
if (messageOrPayload && typeof messageOrPayload === 'object') {
|
||||
payload = extractMessagePayload(messageOrPayload.msg ?? messageOrPayload);
|
||||
if (!payload && (messageOrPayload.sender || messageOrPayload.group_id)) {
|
||||
payload = messageOrPayload;
|
||||
}
|
||||
}
|
||||
|
||||
const payloadSender = payload && typeof payload.sender === 'object' ? payload.sender : null;
|
||||
const id = Number(
|
||||
payloadSender?.account_id
|
||||
?? (typeof senderId === 'object' ? senderId.sender_id : senderId)
|
||||
);
|
||||
|
||||
if (payloadSender && payloadSender.name) {
|
||||
const name = payloadSender.name;
|
||||
const alias = payloadSender.group_alias || payload?.group_alias;
|
||||
if (alias && payloadSender.role === 'Gruppe') {
|
||||
const display = `${name} (Gruppe: ${alias})`;
|
||||
return {name: display, isMe: id === currentAccountId};
|
||||
}
|
||||
if (alias) {
|
||||
const display = `${name} (Gruppe: ${alias})`;
|
||||
return {name: display, isMe: id === currentAccountId};
|
||||
}
|
||||
if (payloadSender.role === 'Gruppe') {
|
||||
return {name: `${name} (Gruppe)`, isMe: id === currentAccountId};
|
||||
}
|
||||
return {name, isMe: id === currentAccountId};
|
||||
}
|
||||
|
||||
if (!Number.isFinite(id) || id <= 0) {
|
||||
return {name: 'System', isMe: false};
|
||||
}
|
||||
if (id === currentAccountId) {
|
||||
return {name: 'Ich', isMe: true};
|
||||
}
|
||||
|
||||
const account = dispatcherState.accountById.get(id);
|
||||
const group = dispatcherState.groups.find(item => Number(item.account_id) === id);
|
||||
if (group) return groupDisplayName(group);
|
||||
return id ? `Account ${id}` : 'System';
|
||||
const accountName = account && account.name ? account.name : `Account ${id}`;
|
||||
if (group) {
|
||||
const alias = group.aliasname && String(group.aliasname).trim();
|
||||
if (alias) {
|
||||
return {name: `${accountName} (Gruppe: ${alias})`, isMe: false};
|
||||
}
|
||||
return {name: `${accountName} (Gruppe ${group.id})`, isMe: false};
|
||||
}
|
||||
if (account && account.role === 'Gruppe') {
|
||||
return {name: `${accountName} (Gruppe)`, isMe: false};
|
||||
}
|
||||
return {name: accountName, isMe: false};
|
||||
}
|
||||
|
||||
function senderLabel(senderId) {
|
||||
return getSenderDisplay(senderId).name;
|
||||
}
|
||||
|
||||
function formatChatTime(timestamp) {
|
||||
@@ -1775,12 +1924,21 @@ function addChatMessage(groupId, entry) {
|
||||
dispatcherState.chatKeysByGroup.set(id, new Set());
|
||||
}
|
||||
|
||||
const textForKey = extractMessageText(entry.text ?? entry.msg ?? entry);
|
||||
const keys = dispatcherState.chatKeysByGroup.get(id);
|
||||
const key = `${entry.code}|${entry.sender_id}|${entry.ts}|${entry.text}`;
|
||||
if (keys.has(key)) return;
|
||||
const key = `${entry.code}|${entry.sender_id}|${entry.ts}|${textForKey}`;
|
||||
if (keys.has(key)) {
|
||||
updateGroupLastMessagePreview(id);
|
||||
return;
|
||||
}
|
||||
|
||||
keys.add(key);
|
||||
dispatcherState.chatByGroup.get(id).push(entry);
|
||||
dispatcherState.chatByGroup.get(id).push({
|
||||
...entry,
|
||||
text: textForKey,
|
||||
msg: entry.msg ?? textForKey
|
||||
});
|
||||
updateGroupLastMessagePreview(id);
|
||||
|
||||
if (dispatcherState.chatGroupId === id
|
||||
&& document.getElementById('chatModal').open) {
|
||||
@@ -1788,14 +1946,113 @@ function addChatMessage(groupId, entry) {
|
||||
}
|
||||
}
|
||||
|
||||
function addBroadcastChatMessage(entry) {
|
||||
dispatcherState.groups.forEach(group => addChatMessage(group.id, entry));
|
||||
function showInfoMessage(message) {
|
||||
const dialog = document.getElementById('infoMessageModal');
|
||||
if (!dialog) return;
|
||||
|
||||
const code = Number(message.code);
|
||||
const senderInfo = getSenderDisplay(message.sender_id, message);
|
||||
const sender = senderInfo.name;
|
||||
const payload = extractMessagePayload(message.msg);
|
||||
let receiverId = Number(message.receiver_id);
|
||||
if (!Number.isFinite(receiverId) && payload && payload.group_id !== undefined) {
|
||||
receiverId = Number(payload.group_id);
|
||||
}
|
||||
if (!Number.isFinite(receiverId) && payload && payload.receiver_id !== undefined) {
|
||||
receiverId = Number(payload.receiver_id);
|
||||
}
|
||||
let receiver = '';
|
||||
if (Number.isFinite(receiverId) && receiverId > 0) {
|
||||
const group = dispatcherState.groupById.get(receiverId);
|
||||
const account = dispatcherState.accountById.get(receiverId);
|
||||
if (group) {
|
||||
receiver = `Gruppe ${groupDisplayName(group)}`;
|
||||
} else if (account) {
|
||||
receiver = account.name;
|
||||
} else {
|
||||
receiver = `ID ${receiverId}`;
|
||||
}
|
||||
} else if (code === 1000 || (payload && payload.broadcast)) {
|
||||
receiver = 'alle';
|
||||
}
|
||||
|
||||
document.getElementById('infoMessageCode').textContent = Number.isFinite(code) ? code : '';
|
||||
document.getElementById('infoMessageSender').textContent = receiver ? `${sender} -> ${receiver}` : sender;
|
||||
document.getElementById('infoMessageTime').textContent = formatChatTime(
|
||||
normalizeTimestamp(message.ts) || Date.now()
|
||||
);
|
||||
document.getElementById('infoMessageText').textContent = extractMessageText(message.msg);
|
||||
|
||||
if (typeof dialog.showModal === 'function') {
|
||||
dialog.showModal();
|
||||
} else {
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
function closeInfoMessageModal() {
|
||||
const dialog = document.getElementById('infoMessageModal');
|
||||
if (dialog && dialog.open) dialog.close();
|
||||
}
|
||||
|
||||
function extractMessagePayload(value) {
|
||||
if (value === null || value === undefined) return null;
|
||||
if (typeof value === 'object') {
|
||||
return value;
|
||||
}
|
||||
if (typeof value === 'string') {
|
||||
let text = value;
|
||||
const trimmed = text.trim();
|
||||
if (!trimmed) return null;
|
||||
const colonIndex = trimmed.indexOf(':');
|
||||
if (colonIndex > 0 && colonIndex < 80) {
|
||||
const afterColon = trimmed.slice(colonIndex + 1).trim();
|
||||
if ((afterColon.startsWith('{') && afterColon.endsWith('}'))
|
||||
|| (afterColon.startsWith('[') && afterColon.endsWith(']'))) {
|
||||
try {
|
||||
const parsed = JSON.parse(afterColon);
|
||||
if (parsed && typeof parsed === 'object') return parsed;
|
||||
} catch (error) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((trimmed.startsWith('{') && trimmed.endsWith('}'))
|
||||
|| (trimmed.startsWith('[') && trimmed.endsWith(']'))) {
|
||||
try {
|
||||
const parsed = JSON.parse(trimmed);
|
||||
if (parsed && typeof parsed === 'object') return parsed;
|
||||
} catch (error) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function extractMessageText(value) {
|
||||
if (typeof value === 'string') return value;
|
||||
const payload = extractMessagePayload(value);
|
||||
if (payload && typeof payload === 'object') {
|
||||
if (Object.prototype.hasOwnProperty.call(payload, 'text')) {
|
||||
return String(payload.text ?? '');
|
||||
}
|
||||
if (Object.prototype.hasOwnProperty.call(payload, 'msg')) {
|
||||
return extractMessageText(payload.msg);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
if (value === null || value === undefined) return '';
|
||||
if (typeof value === 'object') return JSON.stringify(value);
|
||||
if (typeof value === 'string') {
|
||||
let text = value;
|
||||
const trimmed = text.trim();
|
||||
if (!trimmed) return '';
|
||||
const colonIndex = trimmed.indexOf(':');
|
||||
if (colonIndex > 0 && colonIndex < 80) {
|
||||
const afterColon = trimmed.slice(colonIndex + 1).trim();
|
||||
if (afterColon) return afterColon;
|
||||
}
|
||||
return trimmed;
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
|
||||
@@ -1853,6 +2110,9 @@ async function connectWebSocket() {
|
||||
ws.send(JSON.stringify({code: 0, msg: token}));
|
||||
dispatcherState.authenticated = true;
|
||||
setConnectionStatus('Verbunden', 'connected');
|
||||
dispatcherState.lastCode0ReceivedAt = Date.now();
|
||||
dispatcherState.heartbeatWarningShown = false;
|
||||
startHeartbeatMonitoring();
|
||||
});
|
||||
|
||||
ws.addEventListener('message', handleWsMessage);
|
||||
@@ -1911,8 +2171,19 @@ function handleWsMessage(event) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.debug('[WS RX]', message);
|
||||
console.log('[WS RX]', JSON.stringify(message));
|
||||
|
||||
switch (Number(message.code)) {
|
||||
case 0:
|
||||
dispatcherState.lastCode0ReceivedAt = Date.now();
|
||||
dispatcherState.heartbeatWarningShown = false;
|
||||
setConnectionStatus('Verbunden', 'connected');
|
||||
startHeartbeatMonitoring();
|
||||
break;
|
||||
case 1:
|
||||
dispatcherState.lastCode0ReceivedAt = Date.now();
|
||||
dispatcherState.heartbeatWarningShown = false;
|
||||
// Heartbeat des Servers beantworten.
|
||||
if (dispatcherState.ws && dispatcherState.ws.readyState === WebSocket.OPEN) {
|
||||
dispatcherState.ws.send(JSON.stringify({code: 2, msg: 'pong'}));
|
||||
@@ -1929,29 +2200,74 @@ function handleWsMessage(event) {
|
||||
break;
|
||||
case 1000: {
|
||||
const text = extractMessageText(message.msg);
|
||||
addBroadcastChatMessage({
|
||||
sender_id: message.sender_id,
|
||||
code: message.code,
|
||||
ts: normalizeTimestamp(message.ts) || Date.now(),
|
||||
text
|
||||
dispatcherState.groups.forEach(group => {
|
||||
addChatMessage(group.id, {
|
||||
sender_id: message.sender_id,
|
||||
code: message.code,
|
||||
ts: normalizeTimestamp(message.ts) || Date.now(),
|
||||
text
|
||||
});
|
||||
});
|
||||
if (Number(message.sender_id) !== currentAccountId) {
|
||||
showInfoMessage({
|
||||
code: message.code,
|
||||
sender_id: message.sender_id,
|
||||
receiver_id: message.receiver_id,
|
||||
msg: text,
|
||||
ts: message.ts
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1100: {
|
||||
const groupId = Number(message.receiver_id);
|
||||
const groupId = Number(message.receiver_id) || Number((message.msg && typeof message.msg === 'object' && message.msg.group_id));
|
||||
const text = extractMessageText(message.msg);
|
||||
addChatMessage(groupId, {
|
||||
sender_id: message.sender_id,
|
||||
code: message.code,
|
||||
ts: normalizeTimestamp(message.ts) || Date.now(),
|
||||
text
|
||||
});
|
||||
if (groupId) {
|
||||
addChatMessage(groupId, {
|
||||
sender_id: message.sender_id,
|
||||
code: message.code,
|
||||
ts: normalizeTimestamp(message.ts) || Date.now(),
|
||||
text
|
||||
});
|
||||
}
|
||||
if (Number(message.sender_id) !== currentAccountId) {
|
||||
showInfoMessage({
|
||||
code: message.code,
|
||||
sender_id: message.sender_id,
|
||||
receiver_id: groupId || message.receiver_id,
|
||||
msg: text,
|
||||
ts: message.ts
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2000:
|
||||
handleGroupChatMessage(message);
|
||||
break;
|
||||
default:
|
||||
if (Number(message.code) >= 1000) {
|
||||
const text = extractMessageText(message.msg);
|
||||
if (Number(message.code) === 1000) {
|
||||
dispatcherState.groups.forEach(group => {
|
||||
addChatMessage(group.id, {
|
||||
sender_id: message.sender_id,
|
||||
code: message.code,
|
||||
ts: normalizeTimestamp(message.ts) || Date.now(),
|
||||
text
|
||||
});
|
||||
});
|
||||
}
|
||||
if (Number(message.sender_id) !== currentAccountId) {
|
||||
showInfoMessage({
|
||||
code: message.code,
|
||||
sender_id: message.sender_id,
|
||||
receiver_id: message.receiver_id,
|
||||
msg: text,
|
||||
ts: message.ts
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2166,12 +2482,16 @@ function sendSpeakerMessage() {
|
||||
const text = input.value.trim();
|
||||
if (!text) return;
|
||||
|
||||
if (sendWs({code: 1000, msg: text})) {
|
||||
if (sendWs({code: 1000, msg: JSON.stringify({text})})) {
|
||||
input.value = '';
|
||||
closeSpeakerModal();
|
||||
}
|
||||
}
|
||||
|
||||
function openGroupMessageModal() {}
|
||||
function closeGroupMessageModal() {}
|
||||
function sendGroupMessageFromDialog() {}
|
||||
|
||||
function showAccordionError(text) {
|
||||
const container = document.getElementById('groupAccordion');
|
||||
container.innerHTML = '';
|
||||
|
||||
Reference in new issue
Block a user