Ensure constant bubble sizes for oversize text.

This commit is contained in:
Matthew Chen 2019-03-15 13:22:54 -04:00
parent 67c89cb4e3
commit 4bfa251321
3 changed files with 1 additions and 20 deletions

View File

@ -281,7 +281,6 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
bodyMediaView = [self loadViewForMediaAlbum];
break;
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
bodyMediaView = [self loadViewForOversizeTextDownload];
break;
}
@ -567,7 +566,6 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
case OWSMessageCellType_GenericAttachment:
case OWSMessageCellType_ContactShare:
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
return NO;
case OWSMessageCellType_MediaMessage:
return YES;
@ -584,7 +582,6 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
case OWSMessageCellType_ContactShare:
case OWSMessageCellType_MediaMessage:
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
return YES;
}
}
@ -895,8 +892,6 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
- (UIView *)loadViewForOversizeTextDownload
{
BOOL isFailed = self.cellType == OWSMessageCellType_OversizeTextFailed;
// We can use an empty view. The progress views will display download
// progress or tap-to-retry UI.
UIView *attachmentView = [UIView new];
@ -1118,7 +1113,6 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
}
break;
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
// There's no way to predict the size of the oversize text,
// so we just use a square bubble.
result = CGSizeMake(maxMessageWidth, maxMessageWidth);
@ -1464,7 +1458,6 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
case OWSMessageCellType_Unknown:
case OWSMessageCellType_TextOnlyMessage:
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
break;
case OWSMessageCellType_Audio:
if (self.viewItem.attachmentStream) {

View File

@ -15,7 +15,6 @@ typedef NS_ENUM(NSInteger, OWSMessageCellType) {
OWSMessageCellType_ContactShare,
OWSMessageCellType_MediaMessage,
OWSMessageCellType_OversizeTextDownloading,
OWSMessageCellType_OversizeTextFailed,
};
NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType);

View File

@ -34,8 +34,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
return @"OWSMessageCellType_MediaMessage";
case OWSMessageCellType_OversizeTextDownloading:
return @"OWSMessageCellType_OversizeTextDownloading";
case OWSMessageCellType_OversizeTextFailed:
return @"OWSMessageCellType_OversizeTextFailed";
}
}
@ -600,9 +598,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
} else if ([oversizeTextAttachment isKindOfClass:[TSAttachmentPointer class]]) {
TSAttachmentPointer *oversizeTextAttachmentPointer = (TSAttachmentPointer *)oversizeTextAttachment;
// TODO: Handle backup restore.
self.messageCellType = (oversizeTextAttachmentPointer.state == TSAttachmentPointerStateFailed
? OWSMessageCellType_OversizeTextFailed
: OWSMessageCellType_OversizeTextDownloading);
self.messageCellType = OWSMessageCellType_OversizeTextDownloading;
self.attachmentPointer = (TSAttachmentPointer *)oversizeTextAttachmentPointer;
return;
} else {
@ -894,7 +890,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
break;
}
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
OWSFailDebug(@"Can't copy not-yet-downloaded attachment");
return;
}
@ -932,7 +927,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
break;
}
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
OWSFailDebug(@"Can't copy not-yet-downloaded attachment");
return;
}
@ -989,7 +983,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
break;
}
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
OWSFailDebug(@"Can't share not-yet-downloaded attachment");
return;
}
@ -1019,7 +1012,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
return NO;
}
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
return NO;
}
}
@ -1060,7 +1052,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
return NO;
}
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
return NO;
}
}
@ -1088,7 +1079,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
break;
}
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
OWSFailDebug(@"Can't save not-yet-downloaded attachment");
return;
}
@ -1168,7 +1158,6 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
case OWSMessageCellType_MediaMessage:
return self.firstValidAlbumAttachment != nil;
case OWSMessageCellType_OversizeTextDownloading:
case OWSMessageCellType_OversizeTextFailed:
return NO;
}
}