Room list: using new chat page

This commit is contained in:
John Livingston
2024-04-03 12:13:44 +02:00
parent 624f053d02
commit e5e6c6f953
7 changed files with 55 additions and 33 deletions

View File

@ -160,8 +160,7 @@ function register (clientOptions: RegisterClientOptions): void {
// 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(clientOptions) +
'/webchat/room/' + encodeURIComponent(localpart) + '?forcetype=1'
const href = '/p/livechat/room?room=' + encodeURIComponent(localpart) + '&forcetype=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')
@ -176,8 +175,7 @@ function register (clientOptions: RegisterClientOptions): void {
} else if (/^[a-zA-A0-9-]+$/.test(localpart)) {
// localpart must be a video uuid.
const uuid = localpart
const href = getBaseRoute(clientOptions) +
'/webchat/room/' + encodeURIComponent(uuid) + '?forcetype=1'
const href = '/p/livechat/room?room=' + encodeURIComponent(uuid) + '&forcetype=1'
const p = fetch('/api/v1/videos/' + uuid, {
method: 'GET',
headers: peertubeHelpers.getAuthHeader()