diff --git a/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@1x.png b/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@1x.png deleted file mode 100644 index cfb7999ef..000000000 Binary files a/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@1x.png and /dev/null differ diff --git a/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@2x.png b/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@2x.png deleted file mode 100644 index ef9fa516c..000000000 Binary files a/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@2x.png and /dev/null differ diff --git a/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@3x.png b/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@3x.png deleted file mode 100644 index 83451545c..000000000 Binary files a/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@3x.png and /dev/null differ diff --git a/Signal/Images.xcassets/table_ic_lock_outline.imageset/Contents.json b/Signal/Images.xcassets/table_ic_verify.imageset/Contents.json similarity index 63% rename from Signal/Images.xcassets/table_ic_lock_outline.imageset/Contents.json rename to Signal/Images.xcassets/table_ic_verify.imageset/Contents.json index 215c3d6b1..ea205df0f 100644 --- a/Signal/Images.xcassets/table_ic_lock_outline.imageset/Contents.json +++ b/Signal/Images.xcassets/table_ic_verify.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "table_ic_lock_outline@1x.png", + "filename" : "table_ic_verify@1x.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "table_ic_lock_outline@2x.png", + "filename" : "table_ic_verify@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "table_ic_lock_outline@3x.png", + "filename" : "table_ic_verify@3x.png", "scale" : "3x" } ], diff --git a/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@1x.png b/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@1x.png new file mode 100644 index 000000000..51cda056b Binary files /dev/null and b/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@1x.png differ diff --git a/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@2x.png b/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@2x.png new file mode 100644 index 000000000..381274ce6 Binary files /dev/null and b/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@2x.png differ diff --git a/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@3x.png b/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@3x.png new file mode 100644 index 000000000..9a536a0bd Binary files /dev/null and b/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@3x.png differ diff --git a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m index 1b481258c..15e017a25 100644 --- a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m +++ b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m @@ -72,6 +72,7 @@ #import #import #import +#import #import #import #import @@ -285,6 +286,10 @@ typedef enum : NSUInteger { selector:@selector(blockedPhoneNumbersDidChange:) name:kNSNotificationName_BlockedPhoneNumbersDidChange object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(identityStateDidChange:) + name:kNSNotificationName_IdentityStateDidChange + object:nil]; } - (void)blockedPhoneNumbersDidChange:(id)notification @@ -294,6 +299,13 @@ typedef enum : NSUInteger { }); } +- (void)identityStateDidChange:(NSNotification *)notification +{ + OWSAssert([NSThread isMainThread]); + + [self updateNavigationBarSubtitleLabel]; +} + - (void)peekSetup { _peek = YES; @@ -1078,6 +1090,7 @@ typedef enum : NSUInteger { - (void)updateNavigationBarSubtitleLabel { NSMutableAttributedString *subtitleText = [NSMutableAttributedString new]; + if (self.thread.isMuted) { // Show a "mute" icon before the navigation bar subtitle if this thread is muted. [subtitleText @@ -1088,6 +1101,26 @@ typedef enum : NSUInteger { NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], }]]; } + + BOOL isVerified = YES; + for (NSString *recipientId in self.thread.recipientIdentifiers) { + if ([[OWSIdentityManager sharedManager] verificationStateForRecipientId:recipientId] + != OWSVerificationStateVerified) { + isVerified = NO; + break; + } + } + if (isVerified) { + // Show a "checkmark" icon before the navigation bar subtitle if this thread is verified. + [subtitleText + appendAttributedString:[[NSAttributedString alloc] + initWithString:@"\uf00c " + attributes:@{ + NSFontAttributeName : [UIFont ows_fontAwesomeFont:10.f], + NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], + }]]; + } + [subtitleText appendAttributedString:[[NSAttributedString alloc] initWithString:NSLocalizedString(@"MESSAGES_VIEW_TITLE_SUBTITLE", diff --git a/Signal/src/ViewControllers/FingerprintViewController.m b/Signal/src/ViewControllers/FingerprintViewController.m index 58152b5a5..a0a1ea0cd 100644 --- a/Signal/src/ViewControllers/FingerprintViewController.m +++ b/Signal/src/ViewControllers/FingerprintViewController.m @@ -256,7 +256,7 @@ typedef void (^CustomLayoutBlock)(); OWSBezierPathView *fingerprintCircle = [OWSBezierPathView new]; [fingerprintCircle setConfigureShapeLayerBlock:^(CAShapeLayer *layer, CGRect bounds) { - layer.fillColor = [UIColor colorWithWhite:0.8f alpha:1.f].CGColor; + layer.fillColor = [UIColor colorWithWhite:0.9f alpha:1.f].CGColor; CGFloat size = MIN(bounds.size.width, bounds.size.height); CGRect circle = CGRectMake((bounds.size.width - size) * 0.5f, (bounds.size.height - size) * 0.5f, size, size); layer.path = [UIBezierPath bezierPathWithOvalInRect:circle].CGPath; @@ -275,7 +275,7 @@ typedef void (^CustomLayoutBlock)(); UILabel *scanLabel = [UILabel new]; scanLabel.text = NSLocalizedString(@"PRIVACY_TAP_TO_SCAN", @"Button that shows the 'scan with camera' view."); scanLabel.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)]; - scanLabel.textColor = [UIColor whiteColor]; + scanLabel.textColor = [UIColor colorWithWhite:0.15f alpha:1.f]; [scanLabel sizeToFit]; [fingerprintView addSubview:scanLabel]; @@ -315,20 +315,53 @@ typedef void (^CustomLayoutBlock)(); BOOL isVerified = [[OWSIdentityManager sharedManager] verificationStateForRecipientId:self.recipientId] == OWSVerificationStateVerified; - self.verificationStateLabel.text = [NSString - stringWithFormat: - (isVerified - ? NSLocalizedString(@"PRIVACY_IDENTITY_IS_VERIFIED_FORMAT", - @"Label indicating that the user is verified. Embeds {{the user's name or phone number}}.") - : NSLocalizedString(@"PRIVACY_IDENTITY_IS_NOT_VERIFIED_FORMAT", - @"Label indicating that the user is not verified. Embeds {{the user's name or phone " - @"number}}.")), - self.contactName]; - self.verifyUnverifyButtonLabel.text - = (isVerified ? NSLocalizedString(@"PRIVACY_UNVERIFY_BUTTON", - @"Button that lets user mark another user's identity as unverified.") - : NSLocalizedString(@"PRIVACY_VERIFY_BUTTON", - @"Button that lets user mark another user's identity as verified.")); + if (isVerified) { + NSMutableAttributedString *labelText = [NSMutableAttributedString new]; + + if (isVerified) { + // Show a "checkmark" if this user is verified. + [labelText + appendAttributedString:[[NSAttributedString alloc] + initWithString:@"\uf00c " + attributes:@{ + NSFontAttributeName : [UIFont + ows_fontAwesomeFont:self.verificationStateLabel.font.pointSize], + }]]; + } + + [labelText + appendAttributedString: + [[NSAttributedString alloc] + initWithString:[NSString stringWithFormat:NSLocalizedString(@"PRIVACY_IDENTITY_IS_VERIFIED_FORMAT", + @"Label indicating that the user is verified. Embeds " + @"{{the user's name or phone number}}."), + self.contactName]]]; + self.verificationStateLabel.attributedText = labelText; + + self.verifyUnverifyButtonLabel.text = NSLocalizedString( + @"PRIVACY_UNVERIFY_BUTTON", @"Button that lets user mark another user's identity as unverified."); + } else { + self.verificationStateLabel.text = [NSString + stringWithFormat:NSLocalizedString(@"PRIVACY_IDENTITY_IS_NOT_VERIFIED_FORMAT", + @"Label indicating that the user is not verified. Embeds {{the user's name or phone " + @"number}}."), + self.contactName]; + + NSMutableAttributedString *buttonText = [NSMutableAttributedString new]; + // Show a "checkmark" if this user is not verified. + [buttonText + appendAttributedString:[[NSAttributedString alloc] + initWithString:@"\uf00c " + attributes:@{ + NSFontAttributeName : [UIFont + ows_fontAwesomeFont:self.verifyUnverifyButtonLabel.font.pointSize], + }]]; + [buttonText appendAttributedString: + [[NSAttributedString alloc] + initWithString:NSLocalizedString(@"PRIVACY_VERIFY_BUTTON", + @"Button that lets user mark another user's identity as verified.")]]; + self.verifyUnverifyButtonLabel.attributedText = buttonText; + } [self.view setNeedsLayout]; } diff --git a/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m b/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m index a11c97ebd..67c961fce 100644 --- a/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m +++ b/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m @@ -215,7 +215,7 @@ NS_ASSUME_NONNULL_BEGIN addItem:[OWSTableItem itemWithCustomCellBlock:^{ return [weakSelf disclosureCellWithName:NSLocalizedString(@"VERIFY_PRIVACY", @"table cell label in conversation settings") - iconName:@"table_ic_lock_outline"]; + iconName:@"table_ic_verify"]; } actionBlock:^{ OWSConversationSettingsTableViewController *strongSelf = weakSelf;