Remove the use_vcards settings

VCards will now always be used.
This commit is contained in:
JC Brand 2018-05-04 22:50:41 +02:00
parent 6ac1df43e1
commit 09c55ebc28
3 changed files with 7 additions and 24 deletions

View File

@ -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)

View File

@ -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
----------------------- -----------------------

View File

@ -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 @@
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));
} }
}); });