Commit 71ed5bbd authored by JC Brand's avatar JC Brand

Don't set vcard on the chatbox model

parent 16b2a1b2
...@@ -206,8 +206,6 @@ ...@@ -206,8 +206,6 @@
defaults: { defaults: {
'bookmarked': false, 'bookmarked': false,
'chat_state': undefined, 'chat_state': undefined,
'image': _converse.DEFAULT_IMAGE,
'image_type': _converse.DEFAULT_IMAGE_TYPE,
'num_unread': 0, 'num_unread': 0,
'type': 'chatbox', 'type': 'chatbox',
'message_type': 'chat', 'message_type': 'chat',
......
...@@ -64,14 +64,6 @@ ...@@ -64,14 +64,6 @@
}); });
} }
function updateChatBoxFromVCard (_converse, jid) {
const chatbox = _converse.chatboxes.getChatBox(jid);
if (_.isNil(chatbox)) {
return;
}
_converse.api.vcard.update(chatbox);
}
converse.plugins.add('converse-vcard', { converse.plugins.add('converse-vcard', {
...@@ -155,21 +147,6 @@ ...@@ -155,21 +147,6 @@
_converse.connection.disco.addFeature(Strophe.NS.VCARD); _converse.connection.disco.addFeature(Strophe.NS.VCARD);
}); });
_converse.on('chatBoxInitialized', (chatbox) => {
if (!_converse.use_vcards || chatbox.model.get('type') === 'headline') {
return;
}
_converse.api.waitUntil('rosterInitialized').then(() => {
const jid = chatbox.model.get('jid'),
contact = _converse.roster.get(jid);
if (contact && !contact.get('vcard_updated') ||
_.isUndefined(contact) && _converse.allow_non_roster_messaging) {
updateChatBoxFromVCard(_converse, jid);
}
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
});
_converse.on('initialized', () => { _converse.on('initialized', () => {
_converse.roster.on("add", (contact) => _converse.api.vcard.update(contact)); _converse.roster.on("add", (contact) => _converse.api.vcard.update(contact));
}); });
......
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