Merge tag 'v1.17.1-beta.1'

pull/40/head^2
Scott Nonnenberg 7 years ago
commit 86b26a3e02

@ -19,10 +19,12 @@
const { Message: TypedMessage, Contact, PhoneNumber } = Signal.Types; const { Message: TypedMessage, Contact, PhoneNumber } = Signal.Types;
const { const {
deleteAttachmentData,
deleteExternalMessageFiles, deleteExternalMessageFiles,
getAbsoluteAttachmentPath, getAbsoluteAttachmentPath,
loadAttachmentData, loadAttachmentData,
loadQuoteData, loadQuoteData,
writeNewAttachmentData,
} = window.Signal.Migrations; } = window.Signal.Migrations;
window.AccountCache = Object.create(null); window.AccountCache = Object.create(null);
@ -1033,28 +1035,43 @@
return conversation.queueJob(async () => { return conversation.queueJob(async () => {
try { try {
const now = new Date().getTime(); const now = new Date().getTime();
let attributes = { type: 'private' }; let attributes = {
...conversation.attributes,
};
if (dataMessage.group) { if (dataMessage.group) {
let groupUpdate = null; let groupUpdate = null;
attributes = { attributes = {
...attributes,
type: 'group', type: 'group',
groupId: dataMessage.group.id, groupId: dataMessage.group.id,
}; };
if (dataMessage.group.type === GROUP_TYPES.UPDATE) { if (dataMessage.group.type === GROUP_TYPES.UPDATE) {
attributes = { attributes = {
type: 'group', ...attributes,
groupId: dataMessage.group.id,
name: dataMessage.group.name, name: dataMessage.group.name,
avatar: dataMessage.group.avatar,
members: _.union( members: _.union(
dataMessage.group.members, dataMessage.group.members,
conversation.get('members') conversation.get('members')
), ),
}; };
// Update this group conversations's avatar on disk if it has changed.
if (dataMessage.group.avatar) {
attributes = await window.Signal.Types.Conversation.maybeUpdateAvatar(
attributes,
dataMessage.group.avatar.data,
{
writeNewAttachmentData,
deleteAttachmentData,
}
);
}
groupUpdate = groupUpdate =
conversation.changedAttributes( conversation.changedAttributes(
_.pick(dataMessage.group, 'name', 'avatar') _.pick(dataMessage.group, 'name', 'avatar')
) || {}; ) || {};
const difference = _.difference( const difference = _.difference(
attributes.members, attributes.members,
conversation.get('members') conversation.get('members')

@ -119,6 +119,7 @@ function initializeMigrations({
return { return {
attachmentsPath, attachmentsPath,
deleteAttachmentData: deleteOnDisk,
deleteExternalMessageFiles: MessageType.deleteAllExternalFiles({ deleteExternalMessageFiles: MessageType.deleteAllExternalFiles({
deleteAttachmentData: Type.deleteData(deleteOnDisk), deleteAttachmentData: Type.deleteData(deleteOnDisk),
deleteOnDisk, deleteOnDisk,
@ -131,8 +132,6 @@ function initializeMigrations({
loadMessage: MessageType.createAttachmentLoader(loadAttachmentData), loadMessage: MessageType.createAttachmentLoader(loadAttachmentData),
Migrations0DatabaseWithAttachmentData, Migrations0DatabaseWithAttachmentData,
Migrations1DatabaseWithoutAttachmentData, Migrations1DatabaseWithoutAttachmentData,
writeNewAttachmentData: createWriterForNew(attachmentsPath),
deleteAttachmentData: deleteOnDisk,
upgradeMessageSchema: (message, options = {}) => { upgradeMessageSchema: (message, options = {}) => {
const { maxVersion } = options; const { maxVersion } = options;
@ -153,6 +152,7 @@ function initializeMigrations({
writeExistingAttachmentData: createWriterForExisting(attachmentsPath), writeExistingAttachmentData: createWriterForExisting(attachmentsPath),
logger, logger,
}), }),
writeNewAttachmentData: createWriterForNew(attachmentsPath),
}; };
} }

@ -3,7 +3,7 @@
"productName": "Signal", "productName": "Signal",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"repository": "https://github.com/signalapp/Signal-Desktop.git", "repository": "https://github.com/signalapp/Signal-Desktop.git",
"version": "1.17.0", "version": "1.17.1-beta.1",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Open Whisper Systems", "name": "Open Whisper Systems",

@ -819,6 +819,8 @@ export class Message extends React.Component<Props, State> {
} = this.props; } = this.props;
const showRetry = status === 'error' && direction === 'outgoing'; const showRetry = status === 'error' && direction === 'outgoing';
const fileName = attachment ? attachment.fileName : null;
const isDangerous = isFileDangerous(fileName || '');
return ( return (
<ContextMenu id={triggerId}> <ContextMenu id={triggerId}>
@ -827,7 +829,11 @@ export class Message extends React.Component<Props, State> {
attributes={{ attributes={{
className: 'module-message__context__download', className: 'module-message__context__download',
}} }}
onClick={onDownload} onClick={() => {
if (onDownload) {
onDownload(isDangerous);
}
}}
> >
{i18n('downloadAttachment')} {i18n('downloadAttachment')}
</MenuItem> </MenuItem>

Loading…
Cancel
Save