norm OK
This commit is contained in:
parent
1ca84b30c6
commit
c6b0225e51
5 changed files with 18 additions and 24 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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}🔒`);
|
||||
|
|
|
|||
|
|
@ -12,5 +12,3 @@ export function whoBlockedMe(fastify: FastifyInstance, myID: string): BlockRelat
|
|||
blocker: entry.blocked,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue