fix broken test

This commit is contained in:
Michael Kirk 2019-01-04 15:36:51 -07:00
parent 2233d4c72c
commit b95dcd4ae3
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
#import "ConversationViewItem.h"
@ -65,6 +65,7 @@
OWSAssertDebug([[NSFileManager defaultManager] fileExistsAtPath:filePath]);
DataSource *dataSource = [DataSourcePath dataSourceWithFilePath:filePath shouldDeleteOnDeallocation:NO];
dataSource.sourceFilename = filename;
TSAttachmentStream *attachment = [AttachmentStreamFactory createWithContentType:mimeType dataSource:dataSource];
TSOutgoingMessage *message =

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
import Foundation
@ -391,6 +391,7 @@ class AttachmentStreamFactory: NSObject, Factory {
let factory = AttachmentStreamFactory()
factory.contentTypeBuilder = { return contentType }
factory.byteCountBuilder = { return UInt32(dataSource.dataLength()) }
factory.sourceFilenameBuilder = { return dataSource.sourceFilename ?? "fake-filename.dat" }
let attachmentStream = factory.build(transaction: transaction)
dataSource.write(toPath: attachmentStream.originalFilePath!)