1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-21 21: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;
// Notify user
UserWebSocketController.Send(userID, "", new WsMessage({
UserWebSocketController.Send(userID, new WsMessage({
title: "number_notifs",
id: "",
data: await NotificationsHelper.CountUnread(userID)
@ -108,7 +108,7 @@ export class UserWebSocketActions {
continue;
// Notify user
UserWebSocketController.Send(userID, "", new WsMessage({
UserWebSocketController.Send(userID, new WsMessage({
title: "number_unread_conversations",
id: "",
data: await ConversationsHelper.CountUnreadForUser(userID)

View File

@ -212,14 +212,10 @@ export class UserWebSocketController {
* Send a message to a socket
*
* @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
*/
public static Send(userID: number, socketID: string, message: WsMessage) {
for(const entry of this.active_clients.filter(
(e) => e.userID == userID
&& (socketID.length == 0 || e.socketID == socketID)))
public static Send(userID: number, message: WsMessage) {
for(const entry of this.active_clients.filter((e) => e.userID == userID))
{
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!")
// Send the response
UserWebSocketController.Send(this.wsClient.userID, this.wsClient.socketID, new WsMessage({
UserWebSocketController.SendToClient(this.wsClient, new WsMessage({
title: title,
data: data,
id: this.req.id