aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users/notifications.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/users/notifications.ts')
-rw-r--r--shared/extra-utils/users/notifications.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/shared/extra-utils/users/notifications.ts b/shared/extra-utils/users/notifications.ts
index 0af7d8a18..9196f0bf5 100644
--- a/shared/extra-utils/users/notifications.ts
+++ b/shared/extra-utils/users/notifications.ts
@@ -49,7 +49,7 @@ async function checkNotification (
49 const check = base.check || { web: true, mail: true } 49 const check = base.check || { web: true, mail: true }
50 50
51 if (check.web) { 51 if (check.web) {
52 const notification = await base.server.notificationsCommand.getLastest({ token: base.token }) 52 const notification = await base.server.notifications.getLastest({ token: base.token })
53 53
54 if (notification || checkType !== 'absence') { 54 if (notification || checkType !== 'absence') {
55 notificationChecker(notification, checkType) 55 notificationChecker(notification, checkType)
@@ -651,31 +651,31 @@ async function prepareNotificationsTest (serversCount = 3, overrideConfigArg: an
651 } 651 }
652 652
653 const user = { username: 'user_1', password: 'super password' } 653 const user = { username: 'user_1', password: 'super password' }
654 await servers[0].usersCommand.create({ ...user, videoQuota: 10 * 1000 * 1000 }) 654 await servers[0].users.create({ ...user, videoQuota: 10 * 1000 * 1000 })
655 const userAccessToken = await servers[0].loginCommand.getAccessToken(user) 655 const userAccessToken = await servers[0].login.getAccessToken(user)
656 656
657 await servers[0].notificationsCommand.updateMySettings({ token: userAccessToken, settings: getAllNotificationsSettings() }) 657 await servers[0].notifications.updateMySettings({ token: userAccessToken, settings: getAllNotificationsSettings() })
658 await servers[0].notificationsCommand.updateMySettings({ settings: getAllNotificationsSettings() }) 658 await servers[0].notifications.updateMySettings({ settings: getAllNotificationsSettings() })
659 659
660 if (serversCount > 1) { 660 if (serversCount > 1) {
661 await servers[1].notificationsCommand.updateMySettings({ settings: getAllNotificationsSettings() }) 661 await servers[1].notifications.updateMySettings({ settings: getAllNotificationsSettings() })
662 } 662 }
663 663
664 { 664 {
665 const socket = servers[0].socketIOCommand.getUserNotificationSocket({ token: userAccessToken }) 665 const socket = servers[0].socketIO.getUserNotificationSocket({ token: userAccessToken })
666 socket.on('new-notification', n => userNotifications.push(n)) 666 socket.on('new-notification', n => userNotifications.push(n))
667 } 667 }
668 { 668 {
669 const socket = servers[0].socketIOCommand.getUserNotificationSocket() 669 const socket = servers[0].socketIO.getUserNotificationSocket()
670 socket.on('new-notification', n => adminNotifications.push(n)) 670 socket.on('new-notification', n => adminNotifications.push(n))
671 } 671 }
672 672
673 if (serversCount > 1) { 673 if (serversCount > 1) {
674 const socket = servers[1].socketIOCommand.getUserNotificationSocket() 674 const socket = servers[1].socketIO.getUserNotificationSocket()
675 socket.on('new-notification', n => adminNotificationsServer2.push(n)) 675 socket.on('new-notification', n => adminNotificationsServer2.push(n))
676 } 676 }
677 677
678 const { videoChannels } = await servers[0].usersCommand.getMyInfo() 678 const { videoChannels } = await servers[0].users.getMyInfo()
679 const channelId = videoChannels[0].id 679 const channelId = videoChannels[0].id
680 680
681 return { 681 return {