diff --git a/CHANGES.md b/CHANGES.md index 944c042f4..1ec5391fb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/spec/controlbox.js b/spec/controlbox.js index b6f016ba1..eb80a299a 100644 --- a/spec/controlbox.js +++ b/spec/controlbox.js @@ -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'); diff --git a/src/converse-rosterview.js b/src/converse-rosterview.js index 5b08ae14e..68a6d32ea 100644 --- a/src/converse-rosterview.js +++ b/src/converse-rosterview.js @@ -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"]');