From d300be58ccb583589aba7ac2d44881b3aaf12f06 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 28 Mar 2019 15:35:37 +0100 Subject: [PATCH] Fixes #144. Fall back to JID if name is not available --- CHANGES.md | 1 + dist/converse.js | 4 ++-- src/converse-rosterview.js | 2 +- src/headless/converse-roster.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3f162d9db..b24be7216 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -30,6 +30,7 @@ - #1467: Fix rendering of URLs enclosed with sharp brackets such as - #1479: Allow file upload by drag & drop also in MUCs - #1487: New config option [muc_respect_autojoin](https://conversejs.org/docs/html/configuration.html#muc-respect-autojoin) +- #1488: In error message, fall back to JID if name is not available. - #1501: Don't prompt for a reason if [auto_join_on_invite](https://conversejs.org/docs/html/configuration.html#auto-join-on-invite) is `true` - #1507: Make message id and origin-id identical in order to fix LMC with Conversations - #1508: Minimized bookmarked chatboxes should not be always maximized after page reload. diff --git a/dist/converse.js b/dist/converse.js index 57d6df2ad..80455004c 100644 --- a/dist/converse.js +++ b/dist/converse.js @@ -59548,7 +59548,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].plugins } catch (e) { _converse.log(e, Strophe.LogLevel.ERROR); - _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Sorry, there was an error while trying to remove %1$s as a contact.', name)); + _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Sorry, there was an error while trying to remove %1$s as a contact.', this.model.getDisplayName())); } }, @@ -68687,7 +68687,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins } catch (e) { _converse.log(e, Strophe.LogLevel.ERROR); - alert(__('Sorry, there was an error while trying to add %1$s as a contact.', name)); + alert(__('Sorry, there was an error while trying to add %1$s as a contact.', name || jid)); return e; } diff --git a/src/converse-rosterview.js b/src/converse-rosterview.js index 9ba4217e5..0a6cf536f 100644 --- a/src/converse-rosterview.js +++ b/src/converse-rosterview.js @@ -563,7 +563,7 @@ converse.plugins.add('converse-rosterview', { _converse.log(e, Strophe.LogLevel.ERROR); _converse.api.alert.show( Strophe.LogLevel.ERROR, - __('Sorry, there was an error while trying to remove %1$s as a contact.', name) + __('Sorry, there was an error while trying to remove %1$s as a contact.', this.model.getDisplayName()) ); } }, diff --git a/src/headless/converse-roster.js b/src/headless/converse-roster.js index 53adcb36f..53b411e2d 100644 --- a/src/headless/converse-roster.js +++ b/src/headless/converse-roster.js @@ -478,7 +478,7 @@ converse.plugins.add('converse-roster', { await this.sendContactAddIQ(jid, name, groups); } catch (e) { _converse.log(e, Strophe.LogLevel.ERROR); - alert(__('Sorry, there was an error while trying to add %1$s as a contact.', name)); + alert(__('Sorry, there was an error while trying to add %1$s as a contact.', name || jid)); return e; } return this.create(_.assignIn({