]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/users/user-notifications.ts
Introduce accounts command
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / users / user-notifications.ts
index 249e82925c0c7a241c17af2c99fa79e697f67dda..961cfcc0f5d0514d1df863c786d7a01f4c31dc50 100644 (file)
@@ -5,11 +5,10 @@ import { inspect } from 'util'
 import { AbuseState, PluginType } from '@shared/models'
 import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
 import { UserNotification, UserNotificationSetting, UserNotificationSettingValue, UserNotificationType } from '../../models/users'
-import { MockSmtpServer } from '../miscs/email'
+import { MockSmtpServer } from '../mock-servers/mock-email'
 import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests'
 import { doubleFollow } from '../server/follows'
 import { flushAndRunMultipleServers, ServerInfo } from '../server/servers'
-import { getUserNotificationSocket } from '../socket/socket-io'
 import { setAccessTokensToServers, userLogin } from './login'
 import { createUser, getMyUserInformation } from './users'
 
@@ -431,7 +430,7 @@ async function checkNewCommentOnMyVideo (base: CheckerBaseParams, uuid: string,
     }
   }
 
-  const commentUrl = `http://localhost:${base.server.port}/videos/watch/${uuid};threadId=${threadId}`
+  const commentUrl = `http://localhost:${base.server.port}/w/${uuid};threadId=${threadId}`
 
   function emailNotificationFinder (email: object) {
     return email['text'].indexOf(commentUrl) !== -1
@@ -748,16 +747,16 @@ async function prepareNotificationsTest (serversCount = 3, overrideConfigArg: an
   }
 
   {
-    const socket = getUserNotificationSocket(servers[0].url, userAccessToken)
+    const socket = servers[0].socketIOCommand.getUserNotificationSocket({ token: userAccessToken })
     socket.on('new-notification', n => userNotifications.push(n))
   }
   {
-    const socket = getUserNotificationSocket(servers[0].url, servers[0].accessToken)
+    const socket = servers[0].socketIOCommand.getUserNotificationSocket()
     socket.on('new-notification', n => adminNotifications.push(n))
   }
 
   if (serversCount > 1) {
-    const socket = getUserNotificationSocket(servers[1].url, servers[1].accessToken)
+    const socket = servers[1].socketIOCommand.getUserNotificationSocket()
     socket.on('new-notification', n => adminNotificationsServer2.push(n))
   }