Fixes #1579 and fixes #1538

This commit is contained in:
JC Brand 2019-06-19 09:21:46 +02:00
parent 30d110434f
commit 7455ce1b07
3 changed files with 4 additions and 10 deletions

View File

@ -35,12 +35,15 @@
- #1330: Missing room name in MUC invitation popup
- #1445: Participants list uses big font in embedded mode
- #1465: When highlighting a roster contact, they're incorrectly shown as online
- #1502: Fatal error when using prebind
- #1532: Converse reloads on enter pressed in the filter box
- #1538: Allow adding self as contact
- #1550: Legitimate carbons being blocked due to erroneous forgery check
- #1554: Room auto-configuration broke if the config form contained fields with type `fixed`
- #1558: `this.get` is not a function error when `forward_messages` is set to `true`.
- #1572: In `fullscreen` view mode the top is cut off on iOS
- #1576: Converse gets stuck with spinner when logging out with `auto_login` set to `true`
- #1579: Trim spaces at the beginning and end of a JID (when adding contact)
- #1586: Not possible to kick someone with a space in their nickname
### Breaking changes

View File

@ -382,11 +382,6 @@
expect(feedback_el.textContent).toBe('Sorry, could not find a contact with that name');
feedback_el.textContent = '';
input_el.value = 'romeo';
modal.el.querySelector('button[type="submit"]').click();
feedback_el = modal.el.querySelector('.invalid-feedback');
expect(feedback_el.textContent).toBe('You cannot add yourself as a contact');
input_el.value = 'existing';
modal.el.querySelector('button[type="submit"]').click();
feedback_el = modal.el.querySelector('.invalid-feedback');

View File

@ -163,10 +163,6 @@ converse.plugins.add('converse-rosterview', {
u.addClass('is-invalid', this.el.querySelector('input[name="jid"]'));
u.addClass('d-block', el);
return false;
} else if (Strophe.getBareJidFromJid(jid) === _converse.bare_jid) {
el.textContent = __('You cannot add yourself as a contact')
u.addClass('d-block', el);
return false;
} else if (_converse.roster.get(Strophe.getBareJidFromJid(jid))) {
el.textContent = __('This contact has already been added')
u.addClass('d-block', el);
@ -185,7 +181,7 @@ converse.plugins.add('converse-rosterview', {
addContactFromForm (ev) {
ev.preventDefault();
const data = new FormData(ev.target),
jid = data.get('jid');
jid = (data.get('jid') || '').trim();
if (!jid && _converse.xhr_user_search_url && _.isString(_converse.xhr_user_search_url)) {
const input_el = this.el.querySelector('input[name="name"]');