First Major Clean Up Done
This commit is contained in:
parent
949e5a259a
commit
afd79e334c
29 changed files with 46 additions and 118 deletions
23
frontend/src/pages/chat/chatHelperFunctions/getProfil.ts
Normal file
23
frontend/src/pages/chat/chatHelperFunctions/getProfil.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { Socket } from 'socket.io-client';
|
||||
|
||||
/**
|
||||
* getProfil of a user
|
||||
* @param socket
|
||||
* @param user
|
||||
* @returns
|
||||
*/
|
||||
|
||||
export function getProfil(socket: Socket, user: string) {
|
||||
if (!socket.connected) return;
|
||||
const profil = {
|
||||
command: '@profil',
|
||||
destination: 'profilMessage',
|
||||
type: "chat",
|
||||
user: user,
|
||||
token: document.cookie ?? "",
|
||||
text: user,
|
||||
timestamp: Date.now(),
|
||||
SenderWindowID: socket.id,
|
||||
};
|
||||
socket.emit('profilMessage', JSON.stringify(profil));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue