Enhance chat and broadcast functionality with debug logging for image messages. Update chat store to log received messages and their details, and modify broadcast to log image sending events. Increase maxHttpBufferSize for handling larger images in Socket.IO.

This commit is contained in:
Torsten Schulz (local)
2025-12-05 09:29:18 +01:00
parent 7b98f7a5ac
commit 9b4f679f71
3 changed files with 25 additions and 5 deletions

View File

@@ -624,14 +624,21 @@ export function setupBroadcast(io) {
});
// Sende an Empfänger (wenn online)
receiver.socket.emit('message', {
const messagePayload = {
from: client.userName,
message,
messageId,
timestamp: new Date().toISOString(),
isImage: isImage || false,
imageType: imageType || null
});
};
// Debug-Logging für Bilder
if (isImage) {
console.log(`[Bild] Sende Bild von ${client.userName} an ${toUserName}, Größe: ${message ? message.length : 0} Zeichen, Typ: ${imageType || 'unbekannt'}`);
}
receiver.socket.emit('message', messagePayload);
// Bestätigung an Absender
socket.emit('messageSent', {