Does not trim username from jid when joining muc when users are authenticated (entered their usernames).

This commit is contained in:
Damian Minkov 2014-08-08 19:20:50 +03:00
parent aeaa70ca0c
commit 7acb89d5b5
1 changed files with 11 additions and 1 deletions

12
app.js
View File

@ -1,6 +1,7 @@
/* jshint -W117 */
/* application specific logic */
var connection = null;
var authenticatedUser = false;
var focus = null;
var activecall = null;
var RTC = null;
@ -105,6 +106,9 @@ function connect(jid, password) {
});
document.getElementById('connect').disabled = true;
if(password)
authenticatedUser = true;
} else if (status === Strophe.Status.CONNFAIL) {
if(msg === 'x-strophe-bad-non-anon-jid') {
anonymousConnectionFailed = true;
@ -216,7 +220,13 @@ function doJoin() {
roomjid += '/' + Strophe.getNodeFromJid(connection.jid);
}
} else {
roomjid += '/' + Strophe.getNodeFromJid(connection.jid).substr(0, 8);
var tmpJid = Strophe.getNodeFromJid(connection.jid);
if(!authenticatedUser)
tmpJid = tmpJid.substr(0, 8);
roomjid += '/' + tmpJid;
}
connection.emuc.doJoin(roomjid);
}