Merge branch 'charlesmchen/attachmentFilenames'

pull/1/head
Matthew Chen 7 years ago
commit 089c3a5bbe

@ -20,13 +20,11 @@ PODS:
- CocoaLumberjack
- HKDFKit (~> 0.0.3)
- ProtocolBuffers (~> 1.9.8)
- CocoaLumberjack (2.4.0):
- CocoaLumberjack/Default (= 2.4.0)
- CocoaLumberjack/Extensions (= 2.4.0)
- CocoaLumberjack/Core (2.4.0)
- CocoaLumberjack/Default (2.4.0):
- CocoaLumberjack/Core
- CocoaLumberjack/Extensions (2.4.0):
- CocoaLumberjack (3.2.0):
- CocoaLumberjack/Default (= 3.2.0)
- CocoaLumberjack/Extensions (= 3.2.0)
- CocoaLumberjack/Default (3.2.0)
- CocoaLumberjack/Extensions (3.2.0):
- CocoaLumberjack/Default
- HKDFKit (0.0.3)
- JSQMessagesViewController (7.3.4):
@ -39,7 +37,6 @@ PODS:
- OpenSSL (1.0.210)
- ProtocolBuffers (1.9.11)
- PureLayout (3.0.2)
- Reachability (3.2)
- SAMKeychain (1.5.2)
- SignalServiceKit (0.9.0):
- '25519'
@ -53,60 +50,72 @@ PODS:
- TwistedOakCollapsingFutures
- YapDatabase/SQLCipher
- SocketRocket (0.5.1)
- SQLCipher (3.4.1):
- SQLCipher/standard (= 3.4.1)
- SQLCipher/common (3.4.1)
- SQLCipher/fts (3.4.1):
- SQLCipher/standard (3.4.1):
- SQLCipher/common
- TwistedOakCollapsingFutures (1.0.0):
- UnionFind (~> 1.0)
- UnionFind (1.0.1)
- YapDatabase/SQLCipher (2.9.2):
- YapDatabase/SQLCipher/Core (= 2.9.2)
- YapDatabase/SQLCipher/Extensions (= 2.9.2)
- YapDatabase/SQLCipher/Core (2.9.2):
- CocoaLumberjack (~> 2)
- SQLCipher/fts
- YapDatabase/SQLCipher/Extensions (2.9.2):
- YapDatabase/SQLCipher (3.0):
- YapDatabase/SQLCipher/Core (= 3.0)
- YapDatabase/SQLCipher/Extensions (= 3.0)
- YapDatabase/SQLCipher/Core (3.0):
- CocoaLumberjack
- SQLCipher (>= 3.4.0)
- YapDatabase/SQLCipher/Extensions (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/ActionManager (= 3.0)
- YapDatabase/SQLCipher/Extensions/AutoView (= 3.0)
- YapDatabase/SQLCipher/Extensions/CloudCore (= 3.0)
- YapDatabase/SQLCipher/Extensions/CloudKit (= 3.0)
- YapDatabase/SQLCipher/Extensions/ConnectionProxy (= 3.0)
- YapDatabase/SQLCipher/Extensions/CrossProcessNotification (= 3.0)
- YapDatabase/SQLCipher/Extensions/FilteredView (= 3.0)
- YapDatabase/SQLCipher/Extensions/FullTextSearch (= 3.0)
- YapDatabase/SQLCipher/Extensions/Hooks (= 3.0)
- YapDatabase/SQLCipher/Extensions/ManualView (= 3.0)
- YapDatabase/SQLCipher/Extensions/Relationships (= 3.0)
- YapDatabase/SQLCipher/Extensions/RTreeIndex (= 3.0)
- YapDatabase/SQLCipher/Extensions/SearchResultsView (= 3.0)
- YapDatabase/SQLCipher/Extensions/SecondaryIndex (= 3.0)
- YapDatabase/SQLCipher/Extensions/View (= 3.0)
- YapDatabase/SQLCipher/Extensions/ActionManager (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/AutoView
- YapDatabase/SQLCipher/Extensions/AutoView (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/View
- YapDatabase/SQLCipher/Extensions/CloudCore (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/ActionManager (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/CloudKit (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/ConnectionProxy (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/CrossProcessNotification (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/FilteredViews (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/FullTextSearch (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/Hooks (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/Relationships (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/RTreeIndex (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/SearchResults (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/SecondaryIndex (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/Views (= 2.9.2)
- YapDatabase/SQLCipher/Extensions/ActionManager (2.9.2):
- Reachability (~> 3)
- YapDatabase/SQLCipher/Extensions/CloudKit (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/Views
- YapDatabase/SQLCipher/Extensions/CloudKit (2.9.2):
- YapDatabase/SQLCipher/Extensions/ConnectionProxy (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/ConnectionProxy (2.9.2):
- YapDatabase/SQLCipher/Extensions/CrossProcessNotification (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/CrossProcessNotification (2.9.2):
- YapDatabase/SQLCipher/Extensions/FilteredView (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/FilteredViews (2.9.2):
- YapDatabase/SQLCipher/Extensions/View
- YapDatabase/SQLCipher/Extensions/FullTextSearch (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/Views
- YapDatabase/SQLCipher/Extensions/FullTextSearch (2.9.2):
- YapDatabase/SQLCipher/Extensions/Hooks (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/Hooks (2.9.2):
- YapDatabase/SQLCipher/Extensions/ManualView (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/Relationships (2.9.2):
- YapDatabase/SQLCipher/Extensions/View
- YapDatabase/SQLCipher/Extensions/Relationships (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/RTreeIndex (2.9.2):
- YapDatabase/SQLCipher/Extensions/RTreeIndex (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/SearchResults (2.9.2):
- YapDatabase/SQLCipher/Extensions/SearchResultsView (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/AutoView
- YapDatabase/SQLCipher/Extensions/FullTextSearch
- YapDatabase/SQLCipher/Extensions/Views
- YapDatabase/SQLCipher/Extensions/SecondaryIndex (2.9.2):
- YapDatabase/SQLCipher/Extensions/SecondaryIndex (3.0):
- YapDatabase/SQLCipher/Core
- YapDatabase/SQLCipher/Extensions/Views (2.9.2):
- YapDatabase/SQLCipher/Extensions/View (3.0):
- YapDatabase/SQLCipher/Core
DEPENDENCIES:
@ -136,7 +145,7 @@ CHECKOUT OPTIONS:
:commit: 7054e4b13ee5bcd6d524adb6dc9a726e8c466308
:git: https://github.com/WhisperSystems/JSQMessagesViewController.git
SignalServiceKit:
:commit: 52097864f1ce04589bed78a36614413cff8fadee
:commit: 2439752c20250daa7fb6406a66c29e819b23dd66
:git: https://github.com/WhisperSystems/SignalServiceKit.git
SocketRocket:
:commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf
@ -146,7 +155,7 @@ SPEC CHECKSUMS:
'25519': dc4bad7e2dbcbf1efa121068a705a44cd98c80fc
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
AxolotlKit: a9530d6835baae0f204b1f6b9dd79b7901176f0d
CocoaLumberjack: aa9dcab71bdf9eaf2a63bbd9ddc87863efe45457
CocoaLumberjack: 9b4aed7073d242f29cc2f62068d995faf67f703a
HKDFKit: c058305d6f64b84f28c50bd7aa89574625bcb62a
JSQMessagesViewController: 39fed975e3c9f8eba7292071e29eeb541d105e66
JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d
@ -155,14 +164,13 @@ SPEC CHECKSUMS:
OpenSSL: 246ffb948e9d56466727fd318134af35f5aa764e
ProtocolBuffers: d509225eb2ea43d9582a59e94348fcf86e2abd65
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
SAMKeychain: 1865333198217411f35327e8da61b43de79b635b
SignalServiceKit: 59a79a51b89b963ba94db30cc99ed5212da0bb9f
SocketRocket: dbb1554b8fc288ef8ef370d6285aeca7361be31e
SQLCipher: 43d12c0eb9c57fb438749618fc3ce0065509a559
TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
YapDatabase: b1e43555a34a5298e23a045be96817a5ef0da58f
YapDatabase: 0cef6c79948169c924ae325d430ffcfa8a5231c2
PODFILE CHECKSUM: cb2cbbe74dab34123e1cb527417ef658aa60bd26

@ -155,7 +155,11 @@ NS_ASSUME_NONNULL_BEGIN
imageView.layer.cornerRadius = MIN(imageView.bounds.size.width, imageView.bounds.size.height) * 0.5f;
[_cachedMediaView addSubview:imageView];
NSString *fileExtension = self.attachment.filePath.pathExtension;
NSString *filename = self.attachment.sourceFilename;
if (!filename) {
filename = [[self.attachment filePath] lastPathComponent];
}
NSString *fileExtension = filename.pathExtension;
if (fileExtension.length < 1) {
[MIMETypeUtil fileExtensionForMIMEType:self.attachment.contentType];
}
@ -186,7 +190,7 @@ NS_ASSUME_NONNULL_BEGIN
const CGFloat kLabelHSpacing = self.iconHSpacing;
const CGFloat kLabelVSpacing = 2;
NSString *topText =
[self.attachment.filename stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
[self.attachment.sourceFilename stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if (topText.length < 1) {
topText = [MIMETypeUtil fileExtensionForMIMEType:self.attachment.contentType].uppercaseString;
}
@ -203,7 +207,7 @@ NS_ASSUME_NONNULL_BEGIN
NSError *error;
unsigned long long fileSize =
[[NSFileManager defaultManager] attributesOfItemAtPath:self.attachment.filePath error:&error].fileSize;
[[NSFileManager defaultManager] attributesOfItemAtPath:[self.attachment filePath] error:&error].fileSize;
OWSAssert(!error);
NSString *bottomText = [ViewControllerUtils formatFileSize:fileSize];
UILabel *bottomLabel = [UILabel new];

@ -254,7 +254,7 @@ NS_ASSUME_NONNULL_BEGIN
// they have no file name.
//
// TODO: Remove this after the flag has been in production for a few months.
return (self.attachment.isVoiceMessage || self.attachment.filename.length < 1);
return (self.attachment.isVoiceMessage || self.attachment.sourceFilename.length < 1);
}
- (UIView *)createAudioMediaView
@ -287,7 +287,11 @@ NS_ASSUME_NONNULL_BEGIN
const CGFloat kLabelHSpacing = self.audioIconHSpacing;
const CGFloat kLabelVSpacing = 2;
NSString *topText = [[self.attachment.filename stringByDeletingPathExtension]
NSString *filename = self.attachment.sourceFilename;
if (!filename) {
filename = [[self.attachment filePath] lastPathComponent];
}
NSString *topText = [[filename stringByDeletingPathExtension]
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if (topText.length < 1) {
topText = [MIMETypeUtil fileExtensionForMIMEType:self.attachment.contentType].uppercaseString;

@ -3414,7 +3414,7 @@ typedef enum : NSUInteger {
if (newGroupModel.groupImage) {
[self.messageSender sendAttachmentData:UIImagePNGRepresentation(newGroupModel.groupImage)
contentType:OWSMimeTypeImagePng
filename:nil
sourceFilename:nil
inMessage:message
success:^{
DDLogDebug(@"%@ Successfully sent group update with avatar", self.tag);

@ -454,7 +454,7 @@ NS_ASSUME_NONNULL_BEGIN
if (model.groupImage) {
[self.messageSender sendAttachmentData:UIImagePNGRepresentation(model.groupImage)
contentType:OWSMimeTypeImagePng
filename:nil
sourceFilename:nil
inMessage:message
success:popToThread
failure:removeThreadWithError];

@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN
expiresInSeconds:(configuration.isEnabled ? configuration.durationSeconds : 0)];
[messageSender sendAttachmentData:attachment.data
contentType:attachment.mimeType
filename:attachment.filenameOrDefault
sourceFilename:attachment.filenameOrDefault
inMessage:message
success:^{
DDLogDebug(@"%@ Successfully sent message attachment.", self.tag);

@ -26,7 +26,7 @@ class AttachmentPointerView: UIView {
self.isIncoming = isIncoming
self.attachmentPointer = attachmentPointer
let attachmentPointerFilename = attachmentPointer.filename
let attachmentPointerFilename = attachmentPointer.sourceFilename
if let filename = attachmentPointerFilename, !filename.isEmpty {
self.filename = filename
} else {

Loading…
Cancel
Save