Include sender in group update notifications
This commit is contained in:
@@ -422,21 +422,39 @@ async function _addAttachmentToMessage(message, attachment, { type, index }) {
|
||||
return;
|
||||
}
|
||||
|
||||
const existingAvatar = conversation.get('avatar');
|
||||
if (existingAvatar && existingAvatar.path) {
|
||||
await Signal.Migrations.deleteAttachmentData(existingAvatar.path);
|
||||
}
|
||||
|
||||
const loadedAttachment = await Signal.Migrations.loadAttachmentData(
|
||||
attachment
|
||||
);
|
||||
const hash = await computeHash(loadedAttachment.data);
|
||||
const existingAvatar = conversation.get('avatar');
|
||||
|
||||
if (existingAvatar) {
|
||||
if (existingAvatar.hash === hash) {
|
||||
logger.info(
|
||||
'_addAttachmentToMessage: Group avatar hash matched; not replacing group avatar'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
await Signal.Migrations.deleteAttachmentData(existingAvatar.path);
|
||||
}
|
||||
|
||||
conversation.set({
|
||||
avatar: {
|
||||
...attachment,
|
||||
hash: await computeHash(loadedAttachment.data),
|
||||
hash,
|
||||
},
|
||||
});
|
||||
Signal.Data.updateConversation(conversationId, conversation.attributes);
|
||||
|
||||
message.set({
|
||||
group_update: {
|
||||
...message.get('group_update'),
|
||||
avatar: null,
|
||||
avatarUpdated: true,
|
||||
},
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user