Remove CMake configuration and application source files. This includes the deletion of CMakeLists.txt, application logic in app.cpp and app.h, and broadcast functionality in broadcast.cpp. This cleanup streamlines the project structure by removing unused files and configurations.
This commit is contained in:
@@ -67,9 +67,12 @@ const smileys = {
|
||||
};
|
||||
|
||||
function sendMessage() {
|
||||
if (!message.value.trim() || !chatStore.currentConversation) return;
|
||||
const trimmed = message.value.trim();
|
||||
if (!trimmed) return;
|
||||
const isCommand = trimmed.startsWith('/');
|
||||
if (!isCommand && !chatStore.currentConversation) return;
|
||||
|
||||
chatStore.sendMessage(chatStore.currentConversation, message.value.trim());
|
||||
chatStore.sendMessage(chatStore.currentConversation, trimmed);
|
||||
message.value = '';
|
||||
}
|
||||
|
||||
|
||||
@@ -185,6 +185,10 @@ export const useChatStore = defineStore('chat', () => {
|
||||
handleWebSocketMessage({ type: 'historyResults', ...data });
|
||||
});
|
||||
|
||||
socketInstance.on('commandResult', (data) => {
|
||||
handleWebSocketMessage({ type: 'commandResult', ...data });
|
||||
});
|
||||
|
||||
socketInstance.on('unreadChats', (data) => {
|
||||
handleWebSocketMessage({ type: 'unreadChats', ...data });
|
||||
});
|
||||
@@ -287,6 +291,27 @@ export const useChatStore = defineStore('chat', () => {
|
||||
case 'historyResults':
|
||||
historyResults.value = data.results;
|
||||
break;
|
||||
case 'commandResult': {
|
||||
const lines = Array.isArray(data.lines) ? data.lines : [];
|
||||
if (!currentConversation.value) {
|
||||
errorMessage.value = lines.join(' | ');
|
||||
setTimeout(() => {
|
||||
errorMessage.value = null;
|
||||
}, 5000);
|
||||
break;
|
||||
}
|
||||
const timestamp = new Date().toISOString();
|
||||
for (const line of lines) {
|
||||
messages.value.push({
|
||||
from: 'System',
|
||||
message: String(line),
|
||||
timestamp,
|
||||
self: false,
|
||||
isImage: false
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'unreadChats':
|
||||
unreadChatsCount.value = data.count || 0;
|
||||
break;
|
||||
@@ -354,19 +379,23 @@ export const useChatStore = defineStore('chat', () => {
|
||||
}
|
||||
|
||||
const messageId = Date.now().toString();
|
||||
const trimmed = message.trim();
|
||||
const isCommand = trimmed.startsWith('/');
|
||||
socket.value.emit('message', {
|
||||
toUserName,
|
||||
message,
|
||||
message: trimmed,
|
||||
messageId
|
||||
});
|
||||
|
||||
// Lokal hinzufügen
|
||||
messages.value.push({
|
||||
from: userName.value,
|
||||
message,
|
||||
timestamp: new Date().toISOString(),
|
||||
self: true
|
||||
});
|
||||
// Lokal hinzufügen (außer bei Commands, die serverseitig beantwortet werden)
|
||||
if (!isCommand) {
|
||||
messages.value.push({
|
||||
from: userName.value,
|
||||
message: trimmed,
|
||||
timestamp: new Date().toISOString(),
|
||||
self: true
|
||||
});
|
||||
}
|
||||
|
||||
// Timeout zurücksetzen bei Aktivität
|
||||
resetTimeoutTimer();
|
||||
|
||||
Reference in New Issue
Block a user