Commit 9a4081f0 authored by Dele Olajide's avatar Dele Olajide

Jitsi Videobridge - Fixed fault reported at

http://community.igniterealtime.org/message/238552#238552
parent fa99708c
......@@ -78,21 +78,37 @@ Strophe.addConnectionPlugin('emuc', {
$(document).trigger('left.muc', [from]);
return true;
},
onPresenceError: function (pres) {
var from = pres.getAttribute('from');
if ($(pres).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length)
{
var ob = this;
window.setTimeout(function () {
var given = window.prompt('Password required');
if (given != null) {
ob.connection.send($pres({to: ob.myroomjid }).c('x', {xmlns: 'http://jabber.org/protocol/muc'}).c('password').t(given));
} else {
// user aborted
$.prompt('<h2>Password required</h2><input id="lockKey" type="text" placeholder="shared key" autofocus>',
{
persistent: true,
buttons: { "Ok": true , "Cancel": false},
defaultButton: 1,
loaded: function(event) {
document.getElementById('lockKey').focus();
},
submit: function(e,v,m,f){
if(v)
{
var lockKey = document.getElementById('lockKey');
if (lockKey.value !== null)
{
var pres = $pres({to: ob.myroomjid }).c('x', {xmlns: 'http://jabber.org/protocol/muc'}).c('password').t(lockKey.value);
ob.connection.send(pres);
setTimeout(function(){ registerRayoEvents();}, 1000);
}
}
}
}, 50);
});
} else {
console.warn('onPresError ', pres);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment