Merge branch 'hotfix/display-text-crash' into hotfix/2.11.2

pull/1/head
Michael Kirk 9 years ago
commit ee7adca039

@ -98,16 +98,20 @@ NS_ASSUME_NONNULL_BEGIN
: [UIColor lightGrayColor]), : [UIColor lightGrayColor]),
}]]; }]];
} }
[snippetText appendAttributedString:[[NSAttributedString alloc] initWithString:[[DisplayableTextFilter new] displayableText:thread.lastMessageLabel] NSString *displayableText = [[DisplayableTextFilter new] displayableText:thread.lastMessageLabel];
if (displayableText) {
[snippetText appendAttributedString:[[NSAttributedString alloc]
initWithString:displayableText
attributes:@{ attributes:@{
NSFontAttributeName : (thread.hasUnreadMessages NSFontAttributeName : (thread.hasUnreadMessages
? [UIFont ows_mediumFontWithSize:12] ? [UIFont ows_mediumFontWithSize:12]
: [UIFont ows_regularFontWithSize:12]), : [UIFont ows_regularFontWithSize:12]),
NSForegroundColorAttributeName : (thread.hasUnreadMessages NSForegroundColorAttributeName :
? [UIColor ows_blackColor] (thread.hasUnreadMessages ? [UIColor ows_blackColor]
: [UIColor lightGrayColor]), : [UIColor lightGrayColor]),
}]]; }]];
} }
}
NSAttributedString *attributedDate = [self dateAttributedString:thread.lastMessageDate]; NSAttributedString *attributedDate = [self dateAttributedString:thread.lastMessageDate];
NSUInteger unreadCount = [[TSMessagesManager sharedManager] unreadMessagesInThread:thread]; NSUInteger unreadCount = [[TSMessagesManager sharedManager] unreadMessagesInThread:thread];

Loading…
Cancel
Save