Commit c8f72b35 authored by JC Brand's avatar JC Brand

Disable vcard plugin is `use_vcard` is false

parent 535fc7bc
......@@ -730,7 +730,6 @@
events: {
'click a.chatbox-btn.add-contact': 'showAddContactModal',
},
initialize () {
......
......@@ -97,6 +97,11 @@
converse.plugins.add('converse-vcard', {
enabled (_converse) {
_converse.api.settings.update({'use_vcards': true});
return _converse.use_vcards;
},
overrides: {
// Overrides mentioned here will be picked up by converse.js's
// plugin architecture they will replace existing methods on the
......@@ -126,7 +131,6 @@
* loaded by converse.js's plugin machinery.
*/
const { _converse } = this;
_converse.api.settings.update({'use_vcards': true});
_converse.createRequestingContactFromVCard = function (presence, vcard) {
const bare_jid = Strophe.getBareJidFromJid(presence.getAttribute('from'));
......@@ -152,9 +156,7 @@
/* Event handlers */
_converse.on('addClientFeatures', () => {
if (_converse.use_vcards) {
_converse.connection.disco.addFeature(Strophe.NS.VCARD);
}
_converse.connection.disco.addFeature(Strophe.NS.VCARD);
});
_converse.on('chatBoxInitialized', (chatbox) => {
......
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