Skip to content

Commit

Permalink
A user can now add himself as a contact
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosKid42 committed Dec 31, 2019
1 parent 1653c1a commit b89e430
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -30,6 +30,7 @@
- #1772: `_converse.api.contact.add(jid, nick)` fails, says not a function
- #1792: Fix: modals don't have scrollbars
- #1796: Don't show "back" arrow navigation (on mobile) in the chat header when in `singleton` mode
- #1826: A user can now add himself as a contact

### Breaking changes

Expand Down
3 changes: 1 addition & 2 deletions src/headless/converse-roster.js
Expand Up @@ -655,10 +655,9 @@ converse.plugins.add('converse-roster', {
*/
updateContact (item) {
const jid = item.getAttribute('jid');
if (this.isSelf(jid)) { return; }

const contact = this.get(jid);
const subscription = item.getAttribute("subscription");
const subscription = this.isSelf(jid) ? 'both' : item.getAttribute("subscription");
const ask = item.getAttribute("ask");
const groups = Array.from(item.getElementsByTagName('group')).map(e => e.textContent);
if (!contact) {
Expand Down

0 comments on commit b89e430

Please sign in to comment.