Commit 680f3041 authored by JC Brand's avatar JC Brand

Bugfix. Object values for `defaults` passed-by-reference

parent 055c4d21
......@@ -451,6 +451,8 @@
_converse.LoginPanelModel = Backbone.Model.extend({
defaults: {
// Passed-by-reference. Fine in this case because there's
// only one such model.
'errors': [],
}
});
......
......@@ -857,10 +857,8 @@
this.RosterContact = Backbone.Model.extend({
defaults: {
'bookmarked': false,
'chat_state': undefined,
'chat_status': 'offline',
'groups': [],
'image': _converse.DEFAULT_IMAGE,
'image_type': _converse.DEFAULT_IMAGE_TYPE,
'num_unread': 0,
......@@ -873,11 +871,12 @@
const resource = Strophe.getResourceFromJid(jid);
attributes.jid = bare_jid;
this.set(_.assignIn({
'fullname': bare_jid,
'groups': [],
'id': bare_jid,
'jid': bare_jid,
'fullname': bare_jid,
'user_id': Strophe.getNodeFromJid(jid),
'resources': resource ? {resource :0} : {},
'resources': {},
'user_id': Strophe.getNodeFromJid(jid)
}, attributes));
this.on('destroy', () => { this.removeFromRoster(); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment