From 3dcbba57e68986e47b6cc00d1b6f6bdc1a845eb2 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Thu, 5 Aug 2021 18:34:38 +0200 Subject: [PATCH] Room list: force channel or video room. --- client/admin-plugin-client-plugin.ts | 4 ++-- server/lib/routers/webchat.ts | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/client/admin-plugin-client-plugin.ts b/client/admin-plugin-client-plugin.ts index d589928d..227abfd6 100644 --- a/client/admin-plugin-client-plugin.ts +++ b/client/admin-plugin-client-plugin.ts @@ -130,7 +130,7 @@ function register ({ registerHook, registerSettingsScript, peertubeHelpers }: Re // Here we have a channel chat room // The backend should have added informations here // (because the Peertube API can't work with channelId...) - const href = getBaseRoute() + '/webchat/room/' + encodeURIComponent(localpart) + const href = getBaseRoute() + '/webchat/room/' + encodeURIComponent(localpart) + '?fromadmin=1' if (room.channel?.name) { aEl.href = href // here we know that the channel still exists, so we can open the webchat. const aVideoEl = document.createElement('a') @@ -142,7 +142,7 @@ function register ({ registerHook, registerSettingsScript, peertubeHelpers }: Re } else if (/^[a-zA-A0-9-]+$/.test(localpart)) { // localpart must be a video uuid. const uuid = localpart - const href = getBaseRoute() + '/webchat/room/' + encodeURIComponent(uuid) + const href = getBaseRoute() + '/webchat/room/' + encodeURIComponent(uuid) + '?fromadmin=1' const p = fetch('/api/v1/videos/' + uuid, { method: 'GET', headers: peertubeHelpers.getAuthHeader() diff --git a/server/lib/routers/webchat.ts b/server/lib/routers/webchat.ts index 0a8b8e3e..f1604e20 100644 --- a/server/lib/routers/webchat.ts +++ b/server/lib/routers/webchat.ts @@ -52,12 +52,24 @@ async function initWebchatRouter (options: RegisterServerOptions): Promise