mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 05:19:22 +00:00
Remove useless function argument
This commit is contained in:
parent
53d121708d
commit
4ec84dfc06
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user