1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-25 23:09:22 +00:00

Remove useless function argument

This commit is contained in:
Pierre HUBERT 2020-04-01 17:55:44 +02:00
parent 53d121708d
commit 4ec84dfc06
3 changed files with 5 additions and 9 deletions

View File

@ -87,7 +87,7 @@ export class UserWebSocketActions {
continue; continue;
// Notify user // Notify user
UserWebSocketController.Send(userID, "", new WsMessage({ UserWebSocketController.Send(userID, new WsMessage({
title: "number_notifs", title: "number_notifs",
id: "", id: "",
data: await NotificationsHelper.CountUnread(userID) data: await NotificationsHelper.CountUnread(userID)
@ -108,7 +108,7 @@ export class UserWebSocketActions {
continue; continue;
// Notify user // Notify user
UserWebSocketController.Send(userID, "", new WsMessage({ UserWebSocketController.Send(userID, new WsMessage({
title: "number_unread_conversations", title: "number_unread_conversations",
id: "", id: "",
data: await ConversationsHelper.CountUnreadForUser(userID) data: await ConversationsHelper.CountUnreadForUser(userID)

View File

@ -212,14 +212,10 @@ export class UserWebSocketController {
* Send a message to a socket * Send a message to a socket
* *
* @param userID Target user ID * @param userID Target user ID
* @param socketID Target socket ID (if null the message is sent to
* all the active sockets of the user)
* @param message The message to send * @param message The message to send
*/ */
public static Send(userID: number, socketID: string, message: WsMessage) { public static Send(userID: number, message: WsMessage) {
for(const entry of this.active_clients.filter( for(const entry of this.active_clients.filter((e) => e.userID == userID))
(e) => e.userID == userID
&& (socketID.length == 0 || e.socketID == socketID)))
{ {
this.SendToClient(entry, message); this.SendToClient(entry, message);
} }

View File

@ -56,7 +56,7 @@ export class UserWebSocketRequestsHandler extends BaseRequestsHandler {
throw new Error("Trying to send a response to a request to which a response has already been sent!") throw new Error("Trying to send a response to a request to which a response has already been sent!")
// Send the response // Send the response
UserWebSocketController.Send(this.wsClient.userID, this.wsClient.socketID, new WsMessage({ UserWebSocketController.SendToClient(this.wsClient, new WsMessage({
title: title, title: title,
data: data, data: data,
id: this.req.id id: this.req.id