From 87e2635a50ac2decb1c330e55c2ff7b6d07a85de Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 7 Jul 2021 11:55:16 +0200 Subject: Introduce socket io command --- shared/extra-utils/socket/socket-io-command.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 shared/extra-utils/socket/socket-io-command.ts (limited to 'shared/extra-utils/socket/socket-io-command.ts') diff --git a/shared/extra-utils/socket/socket-io-command.ts b/shared/extra-utils/socket/socket-io-command.ts new file mode 100644 index 000000000..545561bed --- /dev/null +++ b/shared/extra-utils/socket/socket-io-command.ts @@ -0,0 +1,15 @@ +import { io } from 'socket.io-client' +import { AbstractCommand, OverrideCommandOptions } from '../shared' + +export class SocketIOCommand extends AbstractCommand { + + getUserNotificationSocket (options: OverrideCommandOptions = {}) { + return io(this.server.url + '/user-notifications', { + query: { accessToken: this.server.accessToken } + }) + } + + getLiveNotificationSocket () { + return io(this.server.url + '/live-videos') + } +} -- cgit v1.2.3 From 5f8bd4cbb178290da7d8f81e996f19f0eccc8e4c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 7 Jul 2021 16:02:46 +0200 Subject: Introduce blocklist command --- shared/extra-utils/socket/socket-io-command.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shared/extra-utils/socket/socket-io-command.ts') diff --git a/shared/extra-utils/socket/socket-io-command.ts b/shared/extra-utils/socket/socket-io-command.ts index 545561bed..c277ead28 100644 --- a/shared/extra-utils/socket/socket-io-command.ts +++ b/shared/extra-utils/socket/socket-io-command.ts @@ -5,7 +5,7 @@ export class SocketIOCommand extends AbstractCommand { getUserNotificationSocket (options: OverrideCommandOptions = {}) { return io(this.server.url + '/user-notifications', { - query: { accessToken: this.server.accessToken } + query: { accessToken: options.token ?? this.server.accessToken } }) } -- cgit v1.2.3