@ -240,15 +240,16 @@ NS_ASSUME_NONNULL_BEGIN
firstSection . customHeaderHeight = @ ( 100. f ) ;
firstSection . customHeaderHeight = @ ( 100. f ) ;
if ( !self . isGroupThread && self . thread . hasSafetyNumbers ) {
if ( !self . isGroupThread && self . thread . hasSafetyNumbers ) {
[ firstSection
[ firstSection addItem : [ OWSTableItem itemWithCustomCellBlock : ^{
addItem : [ OWSTableItem itemWithCustomCellBlock : ^{
return [ weakSelf
return [ weakSelf disclosureCellWithName : NSLocalizedString ( @ "VERIFY_PRIVACY ",
disclosureCellWithName :
@ "table cell label in conversation settings ")
NSLocalizedString ( @ "VERIFY_PRIVACY ",
iconName : @ "table_ic_verify "] ;
@ "Label for button or row which allows users to verify the safety number of another user . ")
}
iconName : @ "table_ic_verify "] ;
actionBlock : ^{
}
[ weakSelf showVerificationView ] ;
actionBlock : ^{
} ] ] ;
[ weakSelf showVerificationView ] ;
} ] ] ;
}
}
[ firstSection
[ firstSection
@ -549,55 +550,51 @@ NS_ASSUME_NONNULL_BEGIN
[ threadTitleLabel autoPinEdgeToSuperviewEdge : ALEdgeLeft ] ;
[ threadTitleLabel autoPinEdgeToSuperviewEdge : ALEdgeLeft ] ;
[ threadTitleLabel autoPinEdgeToSuperviewEdge : ALEdgeRight ] ;
[ threadTitleLabel autoPinEdgeToSuperviewEdge : ALEdgeRight ] ;
const CGFloat kSubtitlePointSize = 12. f ;
__block UIView * lastTitleView = threadTitleLabel ;
NSMutableAttributedString * subtitle = nil ;
if ( ![ self isGroupThread ] ) {
if ( ![ self isGroupThread ] ) {
const CGFloat kSubtitlePointSize = 12. f ;
void ( ^addSubtitle ) ( NSAttributedString * ) = ^( NSAttributedString * subtitle ) {
UILabel * subtitleLabel = [ UILabel new ] ;
subtitleLabel . textColor = [ UIColor ows_darkGrayColor ] ;
subtitleLabel . font = [ UIFont ows_regularFontWithSize : kSubtitlePointSize ] ;
subtitleLabel . attributedText = subtitle ;
subtitleLabel . lineBreakMode = NSLineBreakByTruncatingTail ;
[ threadNameView addSubview : subtitleLabel ] ;
[ subtitleLabel autoPinEdge : ALEdgeTop toEdge : ALEdgeBottom ofView : lastTitleView ] ;
[ subtitleLabel autoPinEdgeToSuperviewEdge : ALEdgeLeft ] ;
lastTitleView = subtitleLabel ;
} ;
NSString * recipientId = self . thread . contactIdentifier ;
NSString * recipientId = self . thread . contactIdentifier ;
BOOL isVerified = [ [ OWSIdentityManager sharedManager ] verificationStateForRecipientId : recipientId ]
== OWSVerificationStateVerified ;
BOOL hasName = ![ self . thread . name isEqualToString : recipientId ] ;
if ( isVerified || hasName ) {
BOOL hasName = ![ self . thread . name isEqualToString : recipientId ] ;
subtitle = [ NSMutableAttributedString new ] ;
if ( hasName ) {
NSAttributedString * subtitle = [ [ NSAttributedString alloc ]
if ( isVerified ) {
initWithString : [ PhoneNumber
/ / "checkmark "
bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber : recipientId ] ] ;
[ subtitle appendAttributedString : [ [ NSAttributedString alloc ]
addSubtitle ( subtitle ) ;
initWithString : @ "\ uf00c "
}
attributes : @ {
NSFontAttributeName :
[ UIFont ows_fontAwesomeFont : kSubtitlePointSize ] ,
} ] ] ;
}
if ( hasName ) {
BOOL isVerified = [ [ OWSIdentityManager sharedManager ] verificationStateForRecipientId : recipientId ]
[ subtitle
== OWSVerificationStateVerified ;
appendAttributedString :
if ( isVerified ) {
[ [ NSAttributedString alloc ]
NSMutableAttributedString * subtitle = [ NSMutableAttributedString new ] ;
initWithString : [ PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber :
/ / "checkmark "
recipientId ] ] ] ;
[ subtitle appendAttributedString : [ [ NSAttributedString alloc ]
} else {
initWithString : @ "\ uf00c "
[ subtitle
attributes : @ {
appendAttributedString : [ [ NSAttributedString alloc ]
NSFontAttributeName :
initWithString : NSLocalizedString ( @ "PRIVACY_IDENTITY_IS_VERIFIED_BADGE ",
[ UIFont ows_fontAwesomeFont : kSubtitlePointSize ] ,
@ "Badge indicating that the user is verified . ") ] ] ;
} ] ] ;
}
[ subtitle appendAttributedString : [ [ NSAttributedString alloc ]
initWithString : NSLocalizedString ( @ "PRIVACY_IDENTITY_IS_VERIFIED_BADGE ",
@ "Badge indicating that the user is verified . ") ] ] ;
addSubtitle ( subtitle ) ;
}
}
}
}
if ( subtitle ) {
[ lastTitleView autoPinEdgeToSuperviewEdge : ALEdgeBottom ] ;
UILabel * threadSubtitleLabel = [ UILabel new ] ;
threadSubtitleLabel . textColor = [ UIColor ows_darkGrayColor ] ;
threadSubtitleLabel . font = [ UIFont ows_regularFontWithSize : kSubtitlePointSize ] ;
threadSubtitleLabel . attributedText = subtitle ;
threadSubtitleLabel . lineBreakMode = NSLineBreakByTruncatingTail ;
[ threadNameView addSubview : threadSubtitleLabel ] ;
[ threadSubtitleLabel autoPinEdgeToSuperviewEdge : ALEdgeBottom ] ;
[ threadSubtitleLabel autoPinEdge : ALEdgeTop toEdge : ALEdgeBottom ofView : threadTitleLabel ] ;
[ threadSubtitleLabel autoPinEdgeToSuperviewEdge : ALEdgeLeft ] ;
} else {
[ threadTitleLabel autoPinEdgeToSuperviewEdge : ALEdgeBottom ] ;
}
[ firstSectionHeader
[ firstSectionHeader
addGestureRecognizer : [ [ UITapGestureRecognizer alloc ] initWithTarget : self
addGestureRecognizer : [ [ UITapGestureRecognizer alloc ] initWithTarget : self
@ -679,11 +676,10 @@ NS_ASSUME_NONNULL_BEGIN
- ( void ) showVerificationView
- ( void ) showVerificationView
{
{
FingerprintViewController * fingerprintViewController = [ FingerprintViewController new ] ;
NSString * recipientId = self . thread . contactIdentifier ;
[ fingerprintViewController configureWithRecipientId : self . thread . contactIdentifier ] ;
OWSAssert ( recipientId . length > 0 ) ;
UINavigationController * navigationController =
[ [ UINavigationController alloc ] initWithRootViewController : fingerprintViewController ] ;
[ FingerprintViewController showVerificationViewFromViewController : self recipientId : recipientId ] ;
[ self presentViewController : navigationController animated : YES completion : nil ] ;
}
}
- ( void ) showGroupMembersView
- ( void ) showGroupMembersView