WIP block guest messages
This commit is contained in:
parent
df192cf227
commit
01da8f4a9f
1 changed files with 5 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ 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;
|
||||
}
|
||||
|
|
@ -72,6 +73,10 @@ 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}` });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue