| 
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -19,7 +19,6 @@ import {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import autoBind from 'auto-bind';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { saveMessage } from '../../ts/data/data';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { ConversationModel, ConversationTypeEnum } from './conversation';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { getSuggestedFilenameSending } from '../types/Attachment';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { actions as conversationActions } from '../state/ducks/conversations';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { VisibleMessage } from '../session/messages/outgoing/visibleMessage/VisibleMessage';
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				import { buildSyncMessage } from '../session/utils/syncUtils';
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -742,15 +741,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      (this.get('attachments') || []).map(window.Signal.Migrations.loadAttachmentData)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    const body = this.get('body');
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    const finalAttachments = attachmentsWithData;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    const filenameOverridenAttachments = finalAttachments.map((attachment: any) => ({
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      ...attachment,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      fileName: getSuggestedFilenameSending({
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        attachment,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        timestamp: Date.now(),
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      }),
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }));
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    const finalAttachments = attachmentsWithData as Array<any>;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    const quoteWithData = await window.Signal.Migrations.loadQuoteData(this.get('quote'));
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    const previewWithData = await window.Signal.Migrations.loadPreviewData(this.get('preview'));
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -765,7 +756,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    // we want to go for the v1, if this is an OpenGroupV1 or not an open group at all
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if (conversation?.isOpenGroupV2()) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      const openGroupV2 = conversation.toOpenGroupV2();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      attachmentPromise = uploadAttachmentsV2(filenameOverridenAttachments, openGroupV2);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      attachmentPromise = uploadAttachmentsV2(finalAttachments, openGroupV2);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      linkPreviewPromise = uploadLinkPreviewsV2(previewWithData, openGroupV2);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      quotePromise = uploadQuoteThumbnailsV2(openGroupV2, quoteWithData);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    } else {
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -774,7 +765,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      const openGroupV1 = conversation?.isOpenGroupV1() ? conversation?.toOpenGroupV1() : undefined;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      attachmentPromise = AttachmentFsV2Utils.uploadAttachmentsToFsV2(
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        filenameOverridenAttachments,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        finalAttachments,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        openGroupV1
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				      linkPreviewPromise = AttachmentFsV2Utils.uploadLinkPreviewsToFsV2(
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
			
			 | 
			 | 
			
				
 
 |