Fix previews of oversize text messages.

pull/1/head
Matthew Chen 7 years ago
parent 83a470d441
commit db6f1326bb

@ -216,11 +216,6 @@ static const NSUInteger OWSMessageSchemaVersion = 4;
// TODO: This method contains view-specific logic and probably belongs in NotificationsManager, not in SSK. // TODO: This method contains view-specific logic and probably belongs in NotificationsManager, not in SSK.
- (NSString *)previewTextWithTransaction:(YapDatabaseReadTransaction *)transaction - (NSString *)previewTextWithTransaction:(YapDatabaseReadTransaction *)transaction
{ {
NSString *_Nullable bodyDescription = nil;
if (self.body.length > 0) {
bodyDescription = self.body;
}
NSString *_Nullable attachmentDescription = nil; NSString *_Nullable attachmentDescription = nil;
if ([self hasAttachments]) { if ([self hasAttachments]) {
NSString *attachmentId = self.attachmentIds[0]; NSString *attachmentId = self.attachmentIds[0];
@ -247,6 +242,11 @@ static const NSUInteger OWSMessageSchemaVersion = 4;
} }
} }
NSString *_Nullable bodyDescription = nil;
if (self.body.length > 0) {
bodyDescription = self.body;
}
if (attachmentDescription.length > 0 && bodyDescription.length > 0) { if (attachmentDescription.length > 0 && bodyDescription.length > 0) {
// Attachment with caption. // Attachment with caption.
if ([CurrentAppContext() isRTL]) { if ([CurrentAppContext() isRTL]) {

Loading…
Cancel
Save