@ -240,10 +240,11 @@ 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 ",
@ "Label for button or row which allows users to verify the safety number of another user . ")
iconName : @ "table_ic_verify "] ;
iconName : @ "table_ic_verify "] ;
}
}
actionBlock : ^{
actionBlock : ^{
@ -549,18 +550,36 @@ 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 ]
initWithString : [ PhoneNumber
bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber : recipientId ] ] ;
addSubtitle ( subtitle ) ;
}
BOOL isVerified = [ [ OWSIdentityManager sharedManager ] verificationStateForRecipientId : recipientId ]
== OWSVerificationStateVerified ;
if ( isVerified ) {
if ( isVerified ) {
NSMutableAttributedString * subtitle = [ NSMutableAttributedString new ] ;
/ / "checkmark "
/ / "checkmark "
[ subtitle appendAttributedString : [ [ NSAttributedString alloc ]
[ subtitle appendAttributedString : [ [ NSAttributedString alloc ]
initWithString : @ "\ uf00c "
initWithString : @ "\ uf00c "
@ -568,36 +587,14 @@ NS_ASSUME_NONNULL_BEGIN
NSFontAttributeName :
NSFontAttributeName :
[ UIFont ows_fontAwesomeFont : kSubtitlePointSize ] ,
[ UIFont ows_fontAwesomeFont : kSubtitlePointSize ] ,
} ] ] ;
} ] ] ;
}
[ subtitle appendAttributedString : [ [ NSAttributedString alloc ]
if ( hasName ) {
[ subtitle
appendAttributedString :
[ [ NSAttributedString alloc ]
initWithString : [ PhoneNumber bestEffortFormatPartialUserSpecifiedTextToLookLikeAPhoneNumber :
recipientId ] ] ] ;
} else {
[ subtitle
appendAttributedString : [ [ NSAttributedString alloc ]
initWithString : NSLocalizedString ( @ "PRIVACY_IDENTITY_IS_VERIFIED_BADGE ",
initWithString : NSLocalizedString ( @ "PRIVACY_IDENTITY_IS_VERIFIED_BADGE ",
@ "Badge indicating that the user is verified . ") ] ] ;
@ "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