merge notifyChangedMe and reloadUser

This commit is contained in:
HF 2021-04-29 03:29:17 +02:00
parent 7788acd909
commit f120fdfdc2
4 changed files with 1 additions and 22 deletions

View File

@ -19,7 +19,7 @@ export default async (req: Request, res: Response) => {
if (name) {
// notify websoecket to reconnect user
// thats a bit counter productive because it directly links to the websocket
webSockets.notifyChangedMe(name);
webSockets.reloadUser(name);
// ---
const index = getHtml(
t`Mail verification`,

View File

@ -252,15 +252,6 @@ class SocketServer extends WebSocketEvents {
}
}
notifyChangedMe(name) {
this.wss.clients.forEach((ws) => {
if (ws.name === name) {
const buffer = ChangedMe.dehydrate();
ws.send(buffer);
}
});
}
reloadUser(name) {
this.wss.clients.forEach(async (ws) => {
if (ws.name === name) {

View File

@ -37,9 +37,6 @@ class WebSocketEvents {
) {
}
notifyChangedMe(name: string) {
}
reloadUser(name: string) {
}

View File

@ -142,15 +142,6 @@ class WebSockets {
);
}
/*
* Notify user on websocket that he should rerequest api/message
*/
notifyChangedMe(name: string) {
this.listeners.forEach(
(listener) => listener.notifyChangedMe(name),
);
}
/*
* reload user on websocket to get changes
*/