Set modifications of model attributes only if the item received from the rosterHandler has different options

This commit is contained in:
ichim-david 2013-02-21 20:57:22 +02:00
parent 95fdf98ea6
commit 447c3a8d41

View File

@ -1414,7 +1414,11 @@
if (!model) {
this.addRosterItem(item.jid, item.subscription, item.ask, item.name);
} else {
model.set({'subscription': item.subscription, 'ask': item.ask});
// only modify model attributes if they are different from the
// ones that were already set when the rosterItem was added
if (model.get('subscription') !== item.subscription || model.get('ask') !== item.ask) {
model.set({'subscription': item.subscription, 'ask': item.ask});
}
}
}
},