From 82a9029c371f1c18721156d4b72b9e46b35b39f3 Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Sat, 21 Mar 2015 15:19:42 +0100 Subject: [PATCH] Fixes #713 --- Podfile | 2 +- Podfile.lock | 10 +++--- Pods | 2 +- Signal.xcodeproj/project.pbxproj | 2 ++ .../src/textsecure/Messages/TSInfoMessage.m | 10 +++--- .../view controllers/MessagesViewController.m | 3 ++ .../src/view controllers/TSMessageAdapter.m | 29 ++++++++++++++---- .../translations/en.lproj/Localizable.strings | Bin 23888 -> 24508 bytes 8 files changed, 40 insertions(+), 18 deletions(-) diff --git a/Podfile b/Podfile index 75eab6af8..558dcc3e4 100644 --- a/Podfile +++ b/Podfile @@ -18,6 +18,6 @@ pod 'SSKeychain' pod 'DJWActionSheet' pod 'SocketRocket', :git => 'https://github.com/FredericJacobs/SocketRocket.git', :commit => '73d8a19' -pod 'JSQMessagesViewController', :git => 'https://github.com/WhisperSystems/JSQMessagesViewController', :branch => 'JSignalQ' +pod 'JSQMessagesViewController', :git => 'https://github.com/WhisperSystems/JSQMessagesViewController', :commit => '9be8f6ed65eb55368a5ff767f055158cf585065f' pod 'APDropDownNavToolbar', :git => 'https://github.com/corbett/APDropDownNavToolbar.git', :branch => 'master' pod 'UICKeyChainStore', :podspec => 'Podspecs/UICKeyChainStore.podspec' diff --git a/Podfile.lock b/Podfile.lock index b9480db06..2518ac931 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -34,7 +34,7 @@ PODS: - DJWActionSheet (1.0.4) - FFCircularProgressView (0.5) - HKDFKit (0.0.3) - - JSQMessagesViewController (6.1.3): + - JSQMessagesViewController (7.0.0): - JSQSystemSoundPlayer (~> 2.0.1) - JSQSystemSoundPlayer (2.0.1) - libPhoneNumber-iOS (0.8.4) @@ -67,7 +67,7 @@ DEPENDENCIES: - AxolotlKit (~> 0.6.2) - DJWActionSheet - FFCircularProgressView (>= 0.1) - - JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController`, branch `JSignalQ`) + - JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController`, commit `9be8f6ed65eb55368a5ff767f055158cf585065f`) - libPhoneNumber-iOS (~> 0.8.2) - Mantle (~> 1.5) - OpenSSL (~> 1.0.201) @@ -84,7 +84,7 @@ EXTERNAL SOURCES: :branch: master :git: https://github.com/corbett/APDropDownNavToolbar.git JSQMessagesViewController: - :branch: JSignalQ + :commit: 9be8f6ed65eb55368a5ff767f055158cf585065f :git: https://github.com/WhisperSystems/JSQMessagesViewController SocketRocket: :commit: 73d8a19 @@ -97,7 +97,7 @@ CHECKOUT OPTIONS: :commit: 98a606b343c0ccc6cca1cd243b296325716f21e7 :git: https://github.com/corbett/APDropDownNavToolbar.git JSQMessagesViewController: - :commit: bfb0c58785b33fa30ac3c88ef38477e49a674912 + :commit: 9be8f6ed65eb55368a5ff767f055158cf585065f :git: https://github.com/WhisperSystems/JSQMessagesViewController SocketRocket: :commit: 73d8a19 @@ -112,7 +112,7 @@ SPEC CHECKSUMS: DJWActionSheet: d88b302d7c29523e1e9fb9b62cfac46f59bb90d9 FFCircularProgressView: 723b7a84c412b5d9d2a5531bc716b99965ad7192 HKDFKit: 5998cf1bbb611e7ecc6bd3eaaef8c7a7da7be949 - JSQMessagesViewController: 4cc4ff3b26599e8743166b7e8e908528c8f01a80 + JSQMessagesViewController: 5e6beff1d5aeeea71c45cec4057b9c2c22c0aebd JSQSystemSoundPlayer: 55528c699a283aae2220d3ae7b8b527d2ecef4b4 libPhoneNumber-iOS: dbfc7b4128510a4955df3e5a6f125393fc9ebc2f Mantle: d5fbaf30fbc58031223af13812c060e15934a1fe diff --git a/Pods b/Pods index fd73394e7..58eb38b76 160000 --- a/Pods +++ b/Pods @@ -1 +1 @@ -Subproject commit fd73394e70509ee4e86e3ae1677c44e4fed5cbc5 +Subproject commit 58eb38b760ad0c3af9daf2f497c07bf8a8683bc5 diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 834fd36a6..00b629d72 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -3590,6 +3590,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; @@ -3644,6 +3645,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CURRENT_PROJECT_VERSION = 1; diff --git a/Signal/src/textsecure/Messages/TSInfoMessage.m b/Signal/src/textsecure/Messages/TSInfoMessage.m index a2c408fb9..fbae95eae 100644 --- a/Signal/src/textsecure/Messages/TSInfoMessage.m +++ b/Signal/src/textsecure/Messages/TSInfoMessage.m @@ -37,15 +37,15 @@ - (NSString *)description{ switch (_messageType) { case TSInfoMessageTypeSessionDidEnd: - return @"Secure session was reset."; + return NSLocalizedString(@"SECURE_SESSION_RESET", nil); case TSInfoMessageTypeUnsupportedMessage: - return @"Received unsupported attachment type."; + return NSLocalizedString(@"UNSUPPORTED_ATTACHMENT", nil); case TSInfoMessageUserNotRegistered: - return @"The user is not registered."; + return NSLocalizedString(@"CONTACT_DETAIL_COMM_TYPE_INSECURE", nil); case TSInfoMessageTypeGroupQuit: - return @"You have left the group."; + return NSLocalizedString(@"GROUP_YOU_LEFT", nil); case TSInfoMessageTypeGroupUpdate: - return _customMessage != nil ? _customMessage : @"Updated the group"; + return _customMessage != nil ? _customMessage : NSLocalizedString(@"GROUP_UPDATED", nil); default: break; } diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index e44e468ca..0fe58b024 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -302,6 +302,7 @@ typedef enum : NSUInteger { [groupUpdateButton setAttributedTitle:updateTitle forState:UIControlStateNormal]; [groupUpdateButton addTarget:self action:@selector(updateGroup) forControlEvents:UIControlEventTouchUpInside]; [groupUpdateButton.titleLabel setTextAlignment:NSTextAlignmentCenter]; + [groupUpdateButton.titleLabel setAdjustsFontSizeToFitWidth:YES]; UIBarButtonItem *groupUpdateBarButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:nil]; groupUpdateBarButton.customView = groupUpdateButton; @@ -316,6 +317,7 @@ typedef enum : NSUInteger { UIBarButtonItem *groupLeaveBarButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:nil]; groupLeaveBarButton.customView = groupLeaveButton; groupLeaveBarButton.customView.userInteractionEnabled = YES; + [groupLeaveButton.titleLabel setAdjustsFontSizeToFitWidth:YES]; UIButton* groupMembersButton = [[UIButton alloc] initWithFrame:CGRectMake(0,0,65,24)]; NSMutableAttributedString *membersTitle = [[NSMutableAttributedString alloc] initWithString:NSLocalizedString(@"MEMBERS_BUTTON_TITLE", @"")]; @@ -326,6 +328,7 @@ typedef enum : NSUInteger { UIBarButtonItem *groupMembersBarButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:nil]; groupMembersBarButton.customView = groupMembersButton; groupMembersBarButton.customView.userInteractionEnabled = YES; + [groupMembersButton.titleLabel setAdjustsFontSizeToFitWidth:YES]; self.navController.dropDownToolbar.items =@[spaceEdge, groupUpdateBarButton, spaceMiddleWords, groupLeaveBarButton, spaceMiddleWords, groupMembersBarButton, spaceEdge]; diff --git a/Signal/src/view controllers/TSMessageAdapter.m b/Signal/src/view controllers/TSMessageAdapter.m index a118ae0de..ad9cd19ae 100644 --- a/Signal/src/view controllers/TSMessageAdapter.m +++ b/Signal/src/view controllers/TSMessageAdapter.m @@ -62,11 +62,11 @@ @implementation TSMessageAdapter + (id)messageViewDataWithInteraction:(TSInteraction*)interaction inThread:(TSThread*)thread{ - + TSMessageAdapter *adapter = [[TSMessageAdapter alloc] init]; adapter.messageDate = interaction.date; adapter.identifier = (NSUInteger)interaction.uniqueId; - + if ([thread isKindOfClass:[TSContactThread class]]) { adapter.thread = (TSContactThread*)thread; if ([interaction isKindOfClass:[TSIncomingMessage class]]) { @@ -100,7 +100,7 @@ for (NSString *attachmentID in message.attachments) { TSAttachment *attachment = [TSAttachment fetchObjectWithUniqueID:attachmentID]; - + if ([attachment isKindOfClass:[TSAttachmentStream class]]) { TSAttachmentStream *stream = (TSAttachmentStream*)attachment; if ([stream isImage]) { @@ -154,7 +154,7 @@ else if(adapter.infoMessageType == TSInfoMessageTypeGroupUpdate) { status = kGroupUpdate; } - JSQCall* call = [[JSQCall alloc] initWithCallerId:@"" callerDisplayName:adapter.messageBody date:nil status:status]; + JSQCall* call = [[JSQCall alloc] initWithCallerId:@"" callerDisplayName:adapter.messageBody date:nil status:status displayString:@""]; call.useThumbnail = NO; // disables use of iconography to represent group update actions return call; } @@ -174,6 +174,8 @@ + (JSQCall*)jsqCallForTSCall:(TSCall*)call thread:(TSContactThread*)thread{ CallStatus status = 0; + NSString *name = thread.name; + NSString *detailString = @""; switch (call.callType) { case RPRecentCallTypeOutgoing: @@ -187,7 +189,22 @@ break; } - JSQCall *jsqCall = [[JSQCall alloc] initWithCallerId:thread.contactIdentifier callerDisplayName:thread.name date:call.date status:status]; + switch (status) { + case kCallMissed: + detailString = [NSString stringWithFormat:NSLocalizedString(@"MSGVIEW_MISSED_CALL", nil), name]; + case kCallIncoming: + detailString = [NSString stringWithFormat:NSLocalizedString(@"MSGVIEW_RECEIVED_CALL", nil), name]; + case kCallOutgoing: + detailString = [NSString stringWithFormat:NSLocalizedString(@"MSGVIEW_YOU_CALLED", nil), name]; + default: + break; + } + + JSQCall *jsqCall = [[JSQCall alloc] initWithCallerId:thread.contactIdentifier + callerDisplayName:thread.name + date:call.date + status:status + displayString:detailString]; return jsqCall; } @@ -223,7 +240,7 @@ return self.messageBody; } -- (NSUInteger)hash{ +- (NSUInteger)messageHash{ return self.identifier; } diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index a32de484ca68faf2e1117481d6a92c5d1f9fb2af..f0ac6226d4dd537dfeaca9af70ac87063f83fca1 100644 GIT binary patch delta 394 zcmaJ-!Ab&A6g_TBqDLbxEEosex(LLD1QV0xH0ek-i4cUC(84ry25DuB{^0fvt^-|( zAkq)`2k!fd&V!_I5s!P{JBM>F=f2e}HebX(-t0mRMK}m>&HEl2)p%U^s1R#bb2qSH z;)G=px6wj`zW9FPV2CCLv7yQ;w;0fSsI#JP?kBbAh~XUg=_kXLVS^5xyBjD<3DUEr3< zi>TAEF*-P