Removing a hack:
* replacing loadByUrl by loadByIdOrUuid * breaks compatibility with peertube 3.0.1 * simpler webchat route * fix uuid escaping in iframe uri
This commit is contained in:
@ -43,16 +43,10 @@ function register ({ registerHook, peertubeHelpers }: RegisterOptions): void {
|
||||
let iframeUri = ''
|
||||
if (settings['chat-use-prosody'] || settings['chat-use-builtin']) {
|
||||
// Using the builtin converseJS
|
||||
// FIXME: with Peertube 3.0.1 there is no loadByIdOrUUID method,
|
||||
// we need to pass the complete url.
|
||||
const video = videoCache[uuid]
|
||||
if (video) {
|
||||
const url: string = video.originInstanceUrl + '/videos/watch/' + uuid
|
||||
iframeUri = getBaseRoute() + '/webchat?url=' + encodeURIComponent(url)
|
||||
}
|
||||
iframeUri = getBaseRoute() + '/webchat/room/' + encodeURIComponent(uuid)
|
||||
} else if (!settings['chat-use-builtin']) {
|
||||
iframeUri = settings['chat-uri'] || ''
|
||||
iframeUri = iframeUri.replace(/{{VIDEO_UUID}}/g, uuid)
|
||||
iframeUri = iframeUri.replace(/{{VIDEO_UUID}}/g, encodeURIComponent(uuid))
|
||||
if (!/^https?:\/\//.test(iframeUri)) {
|
||||
logger.error('The webchaturi must begin with https://')
|
||||
return null
|
||||
|
Reference in New Issue
Block a user