Added possibility for members to block broadcast messages from guests

This commit is contained in:
NigeParis 2026-01-08 10:12:12 +01:00 committed by Nigel
parent 01da8f4a9f
commit 7eaa66637a

View file

@ -58,7 +58,6 @@ export async function sendPrivMessage(fastify: FastifyInstance, data: ClientMess
}
let blockMsgFlag: boolean = false;
const UserByID = getUserByName(allUsers, clientInfo.user) ?? '';
const userfiche: User | null = getUserByName(allUsers, clientInfo.user);
if (UserByID === '') {
return;
}
@ -73,10 +72,6 @@ export async function sendPrivMessage(fastify: FastifyInstance, data: ClientMess
if (socket.id === sender) {
continue;
}
if (!userfiche?.id) return;
const boolGuestMsg = fastify.db.getGuestMessage(userfiche?.id);
if (!boolGuestMsg&& userfiche.guest) continue;
if (!blockMsgFlag) {
socket.emit('MsgObjectServer', { message: data });
fastify.log.info({ senderID: `${UserID}`, msgPriv: data.text, target: `${UserByID.id}` });