Commit 09c55ebc authored by JC Brand's avatar JC Brand

Remove the `use_vcards` settings

VCards will now always be used.
parent 6ac1df43
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
## Configuration changes ## Configuration changes
- Removed the `use_vcards` configuration setting, instead VCards are always used.
- Removed the `xhr_custom_status` and `xhr_custom_status_url` configuration - Removed the `xhr_custom_status` and `xhr_custom_status_url` configuration
settings. If you relied on these settings, you can instead listen for the settings. If you relied on these settings, you can instead listen for the
[statusMessageChanged](https://conversejs.org/docs/html/events.html#contactstatusmessagechanged) [statusMessageChanged](https://conversejs.org/docs/html/events.html#contactstatusmessagechanged)
......
...@@ -1371,15 +1371,6 @@ use_otr_by_default ...@@ -1371,15 +1371,6 @@ use_otr_by_default
If set to ``true``, Converse.js will automatically try to initiate an OTR (off-the-record) If set to ``true``, Converse.js will automatically try to initiate an OTR (off-the-record)
encrypted chat session every time you open a chatbox. encrypted chat session every time you open a chatbox.
use_vcards
----------
* Default: ``true``
Determines whether the XMPP server will be queried for roster contacts' VCards
or not. VCards contain extra personal information such as your fullname and
avatar image.
visible_toolbar_buttons visible_toolbar_buttons
----------------------- -----------------------
......
...@@ -52,26 +52,17 @@ ...@@ -52,26 +52,17 @@
*/ */
const to = Strophe.getBareJidFromJid(jid) === _converse.bare_jid ? null : jid; const to = Strophe.getBareJidFromJid(jid) === _converse.bare_jid ? null : jid;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!_converse.use_vcards) { _converse.connection.vcard.get(
if (resolve) { resolve({'jid': jid}); } _.partial(onVCardData, _converse, jid, _, resolve),
} else { to,
_converse.connection.vcard.get( _.partial(onVCardError, _converse, jid, _, resolve)
_.partial(onVCardData, _converse, jid, _, resolve), );
to,
_.partial(onVCardError, _converse, jid, _, resolve)
);
}
}); });
} }
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
...@@ -106,7 +97,7 @@ ...@@ -106,7 +97,7 @@
model: _converse.ModelWithDefaultAvatar, model: _converse.ModelWithDefaultAvatar,
initialize () { initialize () {
this.on('add', (model) => _converse.api.vcard.update(model)); this.on('add', (vcard) => _converse.api.vcard.update(vcard));
} }
}); });
......
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