2
0
Эх сурвалжийг харах

Bugfix. vcard doesn't necessarily have jid

JC Brand 7 жил өмнө
parent
commit
0d8d99b850

+ 1 - 0
src/converse-chatboxes.js

@@ -103,6 +103,7 @@
                     this.messages = new _converse.Messages();
                     this.messages.browserStorage = new Backbone.BrowserStorage[_converse.message_storage](
                         b64_sha1(`converse.messages${this.get('jid')}${_converse.bare_jid}`));
+
                     this.save({
                         // The chat_state will be set to ACTIVE once the chat box is opened
                         // and we listen for change:chat_state, so shouldn't set it to ACTIVE here.

+ 3 - 2
src/converse-vcard.js

@@ -80,12 +80,13 @@
     function updateChatBoxFromVCard (_converse, jid) {
         _converse.api.vcard.get(jid)
             .then((vcard) => {
-                const chatbox = _converse.chatboxes.getChatBox(vcard.jid);
+                const chatbox = _converse.chatboxes.getChatBox(jid);
                 if (!_.isUndefined(chatbox)) {
                     chatbox.save(_.pick(vcard, ['fullname', 'url', 'image_type', 'image', 'vcard_updated']));
                 }
             })
-            .catch(() => {
+            .catch((e) => {
+                _converse.log(e, Strophe.LogLevel.ERROR);
                 _converse.log(
                     "updateChatBoxFromVCard: Error occured while attempting to update chatbox with VCard data",
                     Strophe.LogLevel.ERROR