XMPP client connection WIP:

Adding an option in the «share chat» dialog to display the XMPP room
address.
This commit is contained in:
John Livingston
2023-04-10 18:21:32 +02:00
committed by John Livingston
parent 4d9d9d39b0
commit 4a28991497
14 changed files with 191 additions and 47 deletions

View File

@ -66,10 +66,31 @@ function getIframeUri (
return iframeUriStr
}
function getXMPPUri (
registerOptions: RegisterClientOptions, settings: any, video: Video
): string | null {
// returns something like xmpp:256896ac-199a-4dab-bb3a-4fd916140272@room.instance.tdl?join
if (!settings['prosody-room-allow-s2s']) {
return null
}
let uuid: string
if (settings['prosody-room-type'] === 'channel') {
uuid = 'channel.' + video.channel.id.toString()
} else {
uuid = video.uuid.toString()
}
const hostname = window.location.hostname
return 'xmpp:' + uuid + '@room.' + hostname + '?join'
}
export type {
UriOptions
}
export {
getBaseRoute,
getIframeUri
getIframeUri,
getXMPPUri
}