feat: allow the jitsi-meet:// protocol in the URL box (#706)

* feat: allow the jitsi-meet:// protocol in the URL box

Allow this so that when you send around links to the app and someone
accidentally copy-pastes them into the URL box, things dont break.
This commit is contained in:
Christoph Settgast 2022-02-09 07:34:46 +01:00 committed by GitHub
parent 5e31214142
commit 9601ef83f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,6 +168,12 @@ class Conference extends Component<Props, State> {
* @returns {void}
*/
_loadConference() {
const appProtocolSurplus = `${config.appProtocolPrefix}://`;
// replace the custom url with https, otherwise new URL() raises 'Invalid URL'.
if (this._conference.serverURL.startsWith(appProtocolSurplus)) {
this._conference.serverURL = this._conference.serverURL.replace(appProtocolSurplus, 'https://');
}
const url = new URL(this._conference.room, this._conference.serverURL);
const roomName = url.pathname.split('/').pop();
const host = this._conference.serverURL.replace(/https?:\/\//, '');