Commit c8f72b35 authored by JC Brand's avatar JC Brand

Disable vcard plugin is `use_vcard` is false

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