Added possibility for members to block broadcast messages from guests
This commit is contained in:
parent
01da8f4a9f
commit
7eaa66637a
1 changed files with 0 additions and 5 deletions
|
|
@ -58,7 +58,6 @@ export async function sendPrivMessage(fastify: FastifyInstance, data: ClientMess
|
||||||
}
|
}
|
||||||
let blockMsgFlag: boolean = false;
|
let blockMsgFlag: boolean = false;
|
||||||
const UserByID = getUserByName(allUsers, clientInfo.user) ?? '';
|
const UserByID = getUserByName(allUsers, clientInfo.user) ?? '';
|
||||||
const userfiche: User | null = getUserByName(allUsers, clientInfo.user);
|
|
||||||
if (UserByID === '') {
|
if (UserByID === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -73,10 +72,6 @@ export async function sendPrivMessage(fastify: FastifyInstance, data: ClientMess
|
||||||
if (socket.id === sender) {
|
if (socket.id === sender) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!userfiche?.id) return;
|
|
||||||
const boolGuestMsg = fastify.db.getGuestMessage(userfiche?.id);
|
|
||||||
if (!boolGuestMsg&& userfiche.guest) continue;
|
|
||||||
|
|
||||||
if (!blockMsgFlag) {
|
if (!blockMsgFlag) {
|
||||||
socket.emit('MsgObjectServer', { message: data });
|
socket.emit('MsgObjectServer', { message: data });
|
||||||
fastify.log.info({ senderID: `${UserID}`, msgPriv: data.text, target: `${UserByID.id}` });
|
fastify.log.info({ senderID: `${UserID}`, msgPriv: data.text, target: `${UserByID.id}` });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue