Fix display of empty group updates

Group updates in which nothing change should still display 'Updated the
group'. Previously they would display as empty message bubbles. Fixed by
ensuring that the 'group_update' attribute is set on the model, even if
it is an empty object.

// FREEBIE
This commit is contained in:
lilia 2016-01-12 10:41:24 -08:00
parent 6e97f5ad00
commit b2bed9c51c

View file

@ -266,7 +266,7 @@
var now = new Date().getTime();
var attributes = { type: 'private' };
if (dataMessage.group) {
var group_update = {};
var group_update = null;
attributes = {
type: 'group',
groupId: dataMessage.group.id,
@ -294,7 +294,7 @@
attributes.members = _.without(conversation.get('members'), source);
}
if (_.keys(group_update).length > 0) {
if (group_update !== null) {
message.set({group_update: group_update});
}
}