Render group updates
Not pretty, but it works. Also allows for later localization. Copy/behavior is borrowed from the Android client. Closes #104 Fixes #65
This commit is contained in:
parent
bcff1cf991
commit
d52db8fe6f
6 changed files with 102 additions and 25 deletions
|
@ -138,6 +138,14 @@
|
|||
avatar : pushMessageContent.group.avatar,
|
||||
members : pushMessageContent.group.members,
|
||||
};
|
||||
var group_update = conversation.changedAttributes(_.pick(pushMessageContent.group, 'name', 'avatar'));
|
||||
var difference = _.difference(pushMessageContent.group.members, conversation.get('members'));
|
||||
if (difference.length > 0) {
|
||||
group_update.joined = difference;
|
||||
}
|
||||
if (_.keys(group_update).length > 0) {
|
||||
message.set({group_update: group_update});
|
||||
}
|
||||
}
|
||||
attributes.active_at = now;
|
||||
conversation.set(attributes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue