Fix video forwarding

This commit is contained in:
Josh Perez 2021-12-02 20:05:32 -05:00 committed by GitHub
parent 97d9069876
commit 13de35bea2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 44 deletions

View file

@ -7,7 +7,7 @@ import { batch as batchDispatch } from 'react-redux';
import { debounce, flatten, omit, throttle } from 'lodash';
import { render } from 'mustache';
import type { AttachmentDraftType, AttachmentType } from '../types/Attachment';
import type { AttachmentType } from '../types/Attachment';
import { isGIF } from '../types/Attachment';
import * as Attachment from '../types/Attachment';
import type { StickerPackType as StickerPackDBType } from '../sql/Interface';
@ -1265,31 +1265,16 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
}
const attachments = getAttachmentsForMessage(message.attributes);
const draftAttachments = attachments
.map((item: AttachmentType): AttachmentDraftType | null => {
const { path } = item;
if (!path) {
return null;
}
return {
...item,
path,
pending: false as const,
screenshotPath: item.screenshot?.path,
};
})
.filter(isNotNil);
this.forwardMessageModal = new Whisper.ReactWrapperView({
JSX: window.Signal.State.Roots.createForwardMessageModal(
window.reduxStore,
{
attachments: draftAttachments,
attachments,
doForwardMessage: async (
conversationIds: Array<string>,
messageBody?: string,
includedAttachments?: Array<AttachmentDraftType>,
includedAttachments?: Array<AttachmentType>,
linkPreview?: LinkPreviewType
) => {
try {
@ -1338,7 +1323,7 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
message: MessageModel,
conversationIds: Array<string>,
messageBody?: string,
attachments?: Array<AttachmentDraftType>,
attachments?: Array<AttachmentType>,
linkPreview?: LinkPreviewType
): Promise<boolean> {
log.info(`maybeForwardMessage/${message.idForLogging()}: Starting...`);