Optimization: only query for MAM prefs when necessary

updates #306
This commit is contained in:
JC Brand 2015-07-17 16:42:58 +02:00
parent 393dd6150d
commit d992efc34b

View File

@ -5103,7 +5103,8 @@
},
onFeatureAdded: function (feature) {
if (feature.get('var') == Strophe.NS.MAM) {
var prefs = feature.get('preferences') || {};
if (feature.get('var') == Strophe.NS.MAM && prefs['default'] !== converse.message_archiving) {
// Ask the server for archiving preferences
converse.connection.sendIQ(
$iq({'type': 'get'}).c('prefs', {'xmlns': Strophe.NS.MAM}),