Commit 0d8d99b8 authored by JC Brand's avatar JC Brand

Bugfix. vcard doesn't necessarily have jid

parent b154d6d5
......@@ -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.
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment