Commit adad60e2 authored by JC Brand's avatar JC Brand

Refactor so that nick-deduplication takes VCard nick into account

Updates #968
parent 3849f562
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
- #161 XEP-0363: HTTP File Upload - #161 XEP-0363: HTTP File Upload
- #194 Include entity capabilities in outgoing presence stanzas - #194 Include entity capabilities in outgoing presence stanzas
- #337 API call to update a VCard - #337 API call to update a VCard
- #968 Use nickname from VCard when joining a room
- #1094 Show room members who aren't currently online - #1094 Show room members who aren't currently online
- It's now also possible to edit your VCard via the UI - It's now also possible to edit your VCard via the UI
- Automatically grow/shrink input as text is entered/removed - Automatically grow/shrink input as text is entered/removed
......
...@@ -1106,13 +1106,9 @@ ...@@ -1106,13 +1106,9 @@
}, },
onNickNameNotFound (message) { onNickNameNotFound (message) {
const nick = _converse.xmppstatus.vcard.get('nickname'); const nick = this.getDefaultNickName();
if (nick) { if (nick) {
this.join(nick); this.join(nick);
} else if (_converse.muc_nickname_from_jid) {
// We try to enter the room with the node part of
// the user's JID.
this.join(this.getDefaultNickName());
} else { } else {
this.renderNicknameForm(message); this.renderNicknameForm(message);
} }
...@@ -1124,7 +1120,12 @@ ...@@ -1124,7 +1120,12 @@
* We put this in a separate method so that it can be * We put this in a separate method so that it can be
* overridden by plugins. * overridden by plugins.
*/ */
return Strophe.unescapeNode(Strophe.getNodeFromJid(_converse.bare_jid)); const nick = _converse.xmppstatus.vcard.get('nickname');
if (nick) {
return nick;
} else if (_converse.muc_nickname_from_jid) {
return Strophe.unescapeNode(Strophe.getNodeFromJid(_converse.bare_jid));
}
}, },
onNicknameClash (presence) { onNicknameClash (presence) {
......
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