Bugfix. Object values for defaults
passed-by-reference
This commit is contained in:
parent
055c4d2104
commit
680f30412a
@ -451,6 +451,8 @@
|
|||||||
|
|
||||||
_converse.LoginPanelModel = Backbone.Model.extend({
|
_converse.LoginPanelModel = Backbone.Model.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
|
// Passed-by-reference. Fine in this case because there's
|
||||||
|
// only one such model.
|
||||||
'errors': [],
|
'errors': [],
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -857,10 +857,8 @@
|
|||||||
this.RosterContact = Backbone.Model.extend({
|
this.RosterContact = Backbone.Model.extend({
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
'bookmarked': false,
|
|
||||||
'chat_state': undefined,
|
'chat_state': undefined,
|
||||||
'chat_status': 'offline',
|
'chat_status': 'offline',
|
||||||
'groups': [],
|
|
||||||
'image': _converse.DEFAULT_IMAGE,
|
'image': _converse.DEFAULT_IMAGE,
|
||||||
'image_type': _converse.DEFAULT_IMAGE_TYPE,
|
'image_type': _converse.DEFAULT_IMAGE_TYPE,
|
||||||
'num_unread': 0,
|
'num_unread': 0,
|
||||||
@ -873,11 +871,12 @@
|
|||||||
const resource = Strophe.getResourceFromJid(jid);
|
const resource = Strophe.getResourceFromJid(jid);
|
||||||
attributes.jid = bare_jid;
|
attributes.jid = bare_jid;
|
||||||
this.set(_.assignIn({
|
this.set(_.assignIn({
|
||||||
|
'fullname': bare_jid,
|
||||||
|
'groups': [],
|
||||||
'id': bare_jid,
|
'id': bare_jid,
|
||||||
'jid': bare_jid,
|
'jid': bare_jid,
|
||||||
'fullname': bare_jid,
|
'resources': {},
|
||||||
'user_id': Strophe.getNodeFromJid(jid),
|
'user_id': Strophe.getNodeFromJid(jid)
|
||||||
'resources': resource ? {resource :0} : {},
|
|
||||||
}, attributes));
|
}, attributes));
|
||||||
|
|
||||||
this.on('destroy', () => { this.removeFromRoster(); });
|
this.on('destroy', () => { this.removeFromRoster(); });
|
||||||
|
Loading…
Reference in New Issue
Block a user