include joined and kicked members on local groupUpdate

also only print name update if the name changed
pull/1226/head
Audric Ackermann 5 years ago
parent 696fbd8d7a
commit 797802885c
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -630,6 +630,7 @@
groupId,
'group'
);
const oldMembers = convo.get('members');
const ev = {
groupDetails: {
@ -709,7 +710,6 @@
const updateObj = {
id: groupId,
name: groupName,
avatar: nullAvatar,
recipients,
members,
@ -717,6 +717,19 @@
options,
};
if (!convo.getName() || convo.getName() !== groupName) {
updateObj.name = groupName;
}
const addedMembers = _.difference(updateObj.members, oldMembers);
if (addedMembers.length > 0) {
updateObj.joined = addedMembers;
}
// Check if anyone got kicked:
const removedMembers = _.difference(oldMembers, updateObj.members);
if (removedMembers.length > 0) {
updateObj.kicked = removedMembers;
}
// Send own sender keys and group secret key
if (isMediumGroup) {
const { chainKey, keyIdx } = await window.SenderKeyAPI.getSenderKeys(

@ -1858,7 +1858,7 @@
// if we do set an identifier here, be sure to not sync the message two times in msg.handleMessageSentSuccess()
timestamp: now,
groupId: id,
name,
name: name || this.getName(),
avatar,
members,
admins: this.get('groupAdmins'),

Loading…
Cancel
Save