Honor existing mam user configuration #486

This commit is contained in:
throwaway42 2017-02-11 19:08:26 -03:00 committed by GitHub
parent b07af4c0e5
commit c34dcfaadc

View File

@ -145,7 +145,7 @@
this.updateSettings({
archived_messages_page_size: '20',
message_archiving: 'never', // Supported values are 'always', 'never', 'roster' (https://xmpp.org/extensions/xep-0313.html#prefs)
message_archiving: undefined, // Supported values are 'always', 'never', 'roster' (https://xmpp.org/extensions/xep-0313.html#prefs)
message_archiving_timeout: 8000, // Time (in milliseconds) to wait before aborting MAM request
});
@ -285,7 +285,9 @@
var onFeatureAdded = function (feature) {
var prefs = feature.get('preferences') || {};
if (feature.get('var') === Strophe.NS.MAM && prefs['default'] !== _converse.message_archiving) {
if (feature.get('var') === Strophe.NS.MAM &&
prefs['default'] !== _converse.message_archiving &&
_converse.message_archiving ) {
// Ask the server for archiving preferences
_converse.connection.sendIQ(
$iq({'type': 'get'}).c('prefs', {'xmlns': Strophe.NS.MAM}),