Commit e76dc012 authored by JC Brand's avatar JC Brand

Use nickname from VCard when joining a room

updates #968
parent dd51ad86
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
if (!this.roomspanel.model.get('nick')) { if (!this.roomspanel.model.get('nick')) {
this.roomspanel.model.save({ this.roomspanel.model.save({
nick: _converse.xmppstatus.get('nickname') || Strophe.getNodeFromJid(_converse.bare_jid) nick: _converse.xmppstatus.vcard.get('nickname') || Strophe.getNodeFromJid(_converse.bare_jid)
}); });
} }
_converse.emit('roomsPanelRendered'); _converse.emit('roomsPanelRendered');
...@@ -1106,7 +1106,10 @@ ...@@ -1106,7 +1106,10 @@
}, },
onNickNameNotFound (message) { onNickNameNotFound (message) {
if (_converse.muc_nickname_from_jid) { const nick = _converse.xmppstatus.vcard.get('nickname');
if (nick) {
this.join(nick);
} else if (_converse.muc_nickname_from_jid) {
// We try to enter the room with the node part of // We try to enter the room with the node part of
// the user's JID. // the user's JID.
this.join(this.getDefaultNickName()); this.join(this.getDefaultNickName());
......
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