Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Handles two domains one for anonymous users, and one for authorized one, where only authorized users can create chat rooms.

Damian Minkovaeaa70ca0c3f
diff --git a/app.js b/app.js
index 0ac25d0a72..843c8c65e4 100644
--- a/app.js
+++ b/app.js
@@ -66,7 +66,7 @@ function init() {
return;
}
- var jid = document.getElementById('jid').value || config.hosts.domain || window.location.hostname;
+ var jid = document.getElementById('jid').value || config.hosts.anonymousdomain || config.hosts.domain || window.location.hostname;
connect(jid);
}
diff --git a/config.js b/config.js
index f0fef9c2f9..293d97a1e1 100644
--- a/config.js
+++ b/config.js
@@ -1,6 +1,7 @@
var config = {
hosts: {
domain: 'jitsi-meet.example.com',
+ //anonymousdomain: 'guest.example.com',
muc: 'conference.jitsi-meet.example.com', // FIXME: use XEP-0030
bridge: 'jitsi-videobridge.jitsi-meet.example.com', // FIXME: use XEP-0030
//call_control: 'callcontrol.jitsi-meet.example.com'
diff --git a/muc.js b/muc.js
index af3280b4ce..9ef44de530 100644
--- a/muc.js
+++ b/muc.js
@@ -157,6 +157,17 @@ Strophe.addConnectionPlugin('emuc', {
var from = pres.getAttribute('from');
if ($(pres).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
$(document).trigger('passwordrequired.muc', [from]);
+ } else if ($(pres).find(
+ '>error[type="cancel"]>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
+ var toDomain = Strophe.getDomainFromJid(pres.getAttribute('to'));
+ if(toDomain === config.hosts.anonymousdomain) {
+ // we are connected with anonymous domain and only non anonymous users can create rooms
+ // we must authorize the user
+ $(document).trigger('passwordrequired.main');
+ }
+ else
+ console.warn('onPresError ', pres);
+
} else {
console.warn('onPresError ', pres);
}