Fixes NPE when creating non anonymous room

This commit is contained in:
hristoterezov 2015-01-20 18:07:03 +02:00
parent 6c4a5bd2bc
commit 394738394d
3 changed files with 9 additions and 5 deletions

View File

@ -32,7 +32,7 @@
<script src="libs/modules/RTC.bundle.js?v=6"></script>
<script src="libs/modules/desktopsharing.bundle.js?v=3"></script><!-- desktop sharing -->
<script src="util.js?v=7"></script><!-- utility functions -->
<script src="libs/modules/xmpp.bundle.js?v=2"></script>
<script src="libs/modules/xmpp.bundle.js?v=3"></script>
<script src="app.js?v=28"></script><!-- application logic -->
<script src="libs/modules/API.bundle.js?v=1"></script>

View File

@ -3274,6 +3274,8 @@ module.exports = function(XMPP, eventEmitter) {
.c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'})
.c('x', {xmlns: 'jabber:x:data', type: 'submit'});
var self = this;
this.connection.sendIQ(getForm, function (form) {
if (!$(form).find(
@ -3296,7 +3298,7 @@ module.exports = function(XMPP, eventEmitter) {
formSubmit.c('field', {'var': 'muc#roomconfig_whois'})
.c('value').t('anyone').up().up();
this.connection.sendIQ(formSubmit);
self.connection.sendIQ(formSubmit);
}, function (error) {
console.error("Error getting room configuration form");
@ -3560,7 +3562,7 @@ module.exports = function(XMPP, eventEmitter) {
// Fixes a bug in prosody 0.9.+ https://code.google.com/p/lxmppd/issues/detail?id=373
formsubmit.c('field', {'var': 'muc#roomconfig_whois'}).c('value').t('anyone').up().up();
// FIXME: is muc#roomconfig_passwordprotectedroom required?
this.connection.sendIQ(formsubmit,
ob.connection.sendIQ(formsubmit,
onSuccess,
onError);
} else {

View File

@ -61,6 +61,8 @@ module.exports = function(XMPP, eventEmitter) {
.c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'})
.c('x', {xmlns: 'jabber:x:data', type: 'submit'});
var self = this;
this.connection.sendIQ(getForm, function (form) {
if (!$(form).find(
@ -83,7 +85,7 @@ module.exports = function(XMPP, eventEmitter) {
formSubmit.c('field', {'var': 'muc#roomconfig_whois'})
.c('value').t('anyone').up().up();
this.connection.sendIQ(formSubmit);
self.connection.sendIQ(formSubmit);
}, function (error) {
console.error("Error getting room configuration form");
@ -347,7 +349,7 @@ module.exports = function(XMPP, eventEmitter) {
// Fixes a bug in prosody 0.9.+ https://code.google.com/p/lxmppd/issues/detail?id=373
formsubmit.c('field', {'var': 'muc#roomconfig_whois'}).c('value').t('anyone').up().up();
// FIXME: is muc#roomconfig_passwordprotectedroom required?
this.connection.sendIQ(formsubmit,
ob.connection.sendIQ(formsubmit,
onSuccess,
onError);
} else {