Don't set vcard on the chatbox model

This commit is contained in:
JC Brand 2018-05-03 18:44:02 +02:00
parent 16b2a1b2a9
commit 71ed5bbdd1
2 changed files with 0 additions and 25 deletions

View File

@ -206,8 +206,6 @@
defaults: {
'bookmarked': false,
'chat_state': undefined,
'image': _converse.DEFAULT_IMAGE,
'image_type': _converse.DEFAULT_IMAGE_TYPE,
'num_unread': 0,
'type': 'chatbox',
'message_type': 'chat',

View File

@ -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', {
@ -155,21 +147,6 @@
_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.roster.on("add", (contact) => _converse.api.vcard.update(contact));
});