Set modifications of model attributes only if the item received from the rosterHandler has different options
This commit is contained in:
parent
95fdf98ea6
commit
447c3a8d41
|
@ -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});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user