This commit is contained in:
NigeParis 2025-12-30 17:18:56 +01:00 committed by Maix0
parent 1ca84b30c6
commit c6b0225e51
5 changed files with 18 additions and 24 deletions

View file

@ -28,7 +28,7 @@ export function sendInvite(fastify: FastifyInstance, innerHtml: string, profil:
const data: ClientMessage = {
command: `@${clientInfo}`,
destination: 'inviteMsg',
type: "chat",
type: 'chat',
user: profil.SenderName,
token: '',
text: ' needs some text to work',

View file

@ -66,22 +66,18 @@ export async function sendPrivMessage(fastify: FastifyInstance, data: ClientMess
const user: string = clientChat.get(socket.id)?.user ?? '';
const atUser = `@${user}`;
console.log(color.red, `'DEBUG LOG:'${atUser}' '${data.command}'`)
if (atUser !== data.command || atUser === '' || data.text === '') {
console.log(color.red, 'DEBUG: atUser !== data.command');
continue;
}
console.log(color.green, `USER ID: ${UserID} userName: ${UserByID.name} iD:${UserByID.id}`);
blockMsgFlag = checkNamePair(list, UserID, UserByID.id) || false;
if (socket.id === sender) {
console.log(color.blue, 'sKip Sender ', socket.id);
continue;
}
console.log(color.yellow, `blockFlag=${blockMsgFlag}: Target ${clientInfo.user}`);
if (!blockMsgFlag) {
console.log(color.blue, 'DEBUG Emit message: ', data.command, 'blockMsgFlag: ', blockMsgFlag);
socket.emit('MsgObjectServer', { message: data });
if (senderSocket) {
senderSocket.emit('privMessageCopy', `${data.command}: ${data.text}🔒`);

View file

@ -12,5 +12,3 @@ export function whoBlockedMe(fastify: FastifyInstance, myID: string): BlockRelat
blocker: entry.blocked,
}));
}