diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 11:55:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | 87e2635a50ac2decb1c330e55c2ff7b6d07a85de (patch) | |
tree | d47c126e74189648916b49d7fea588e3488fdbe6 /shared/extra-utils/users/user-notifications.ts | |
parent | 65e6e2602c0d5521f3a6740f7469bb92830ecb53 (diff) | |
download | PeerTube-87e2635a50ac2decb1c330e55c2ff7b6d07a85de.tar.gz PeerTube-87e2635a50ac2decb1c330e55c2ff7b6d07a85de.tar.zst PeerTube-87e2635a50ac2decb1c330e55c2ff7b6d07a85de.zip |
Introduce socket io command
Diffstat (limited to 'shared/extra-utils/users/user-notifications.ts')
-rw-r--r-- | shared/extra-utils/users/user-notifications.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/shared/extra-utils/users/user-notifications.ts b/shared/extra-utils/users/user-notifications.ts index e75946eec..961cfcc0f 100644 --- a/shared/extra-utils/users/user-notifications.ts +++ b/shared/extra-utils/users/user-notifications.ts | |||
@@ -9,7 +9,6 @@ import { MockSmtpServer } from '../mock-servers/mock-email' | |||
9 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' | 9 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' |
10 | import { doubleFollow } from '../server/follows' | 10 | import { doubleFollow } from '../server/follows' |
11 | import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' | 11 | import { flushAndRunMultipleServers, ServerInfo } from '../server/servers' |
12 | import { getUserNotificationSocket } from '../socket/socket-io' | ||
13 | import { setAccessTokensToServers, userLogin } from './login' | 12 | import { setAccessTokensToServers, userLogin } from './login' |
14 | import { createUser, getMyUserInformation } from './users' | 13 | import { createUser, getMyUserInformation } from './users' |
15 | 14 | ||
@@ -748,16 +747,16 @@ async function prepareNotificationsTest (serversCount = 3, overrideConfigArg: an | |||
748 | } | 747 | } |
749 | 748 | ||
750 | { | 749 | { |
751 | const socket = getUserNotificationSocket(servers[0].url, userAccessToken) | 750 | const socket = servers[0].socketIOCommand.getUserNotificationSocket({ token: userAccessToken }) |
752 | socket.on('new-notification', n => userNotifications.push(n)) | 751 | socket.on('new-notification', n => userNotifications.push(n)) |
753 | } | 752 | } |
754 | { | 753 | { |
755 | const socket = getUserNotificationSocket(servers[0].url, servers[0].accessToken) | 754 | const socket = servers[0].socketIOCommand.getUserNotificationSocket() |
756 | socket.on('new-notification', n => adminNotifications.push(n)) | 755 | socket.on('new-notification', n => adminNotifications.push(n)) |
757 | } | 756 | } |
758 | 757 | ||
759 | if (serversCount > 1) { | 758 | if (serversCount > 1) { |
760 | const socket = getUserNotificationSocket(servers[1].url, servers[1].accessToken) | 759 | const socket = servers[1].socketIOCommand.getUserNotificationSocket() |
761 | socket.on('new-notification', n => adminNotificationsServer2.push(n)) | 760 | socket.on('new-notification', n => adminNotificationsServer2.push(n)) |
762 | } | 761 | } |
763 | 762 | ||