From: Chocobozzz Date: Thu, 22 Aug 2019 08:43:11 +0000 (+0200) Subject: Merge branch 'feature/strong-model-types' into develop X-Git-Tag: v2.0.0-rc.1~118 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5c5e587307a27e173333789b5b5167d35f468b01;p=oweals%2Fpeertube.git Merge branch 'feature/strong-model-types' into develop --- 5c5e587307a27e173333789b5b5167d35f468b01 diff --cc server/lib/peertube-socket.ts index 17748fd18,1c7b09175..ad2bb4845 --- a/server/lib/peertube-socket.ts +++ b/server/lib/peertube-socket.ts @@@ -34,14 -32,12 +34,14 @@@ class PeerTubeSocket }) } - sendNotification (userId: number, notification: UserNotificationModel) { + sendNotification (userId: number, notification: UserNotificationModelForApi) { - const socket = this.userNotificationSockets[userId] + const sockets = this.userNotificationSockets[userId] - if (!socket) return + if (!sockets) return - socket.emit('new-notification', notification.toFormattedJSON()) + for (const socket of sockets) { + socket.emit('new-notification', notification.toFormattedJSON()) + } } static get Instance () {