Update for PR feedback.

URLPreviewManager becomes URLPreviewService.
addVerticalWhitespaceToString used instead of heightForCellData multiple times.
All newline characters removed.
This commit is contained in:
Doug
2021-09-08 15:10:13 +01:00
parent 0f88e8e851
commit 1963f35d30
13 changed files with 105 additions and 150 deletions
@@ -527,6 +527,12 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
{
CGFloat additionalVerticalHeight = 0;
// Add vertical whitespace in case of a URL preview.
if (RiotSettings.shared.roomScreenShowsURLPreviews && self.showURLPreview)
{
additionalVerticalHeight += RoomBubbleCellLayout.urlPreviewViewTopMargin + [URLPreviewView contentViewHeightFor:self.urlPreviewData];
}
// Add vertical whitespace in case of reactions.
additionalVerticalHeight+= [self reactionHeightForEventId:eventId];
// Add vertical whitespace in case of read receipts.
@@ -1082,7 +1088,7 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
}
// Don't show the preview if it has been dismissed already.
self.showURLPreview = ![URLPreviewManager.shared hasClosedPreviewFrom:lastComponent.event];
self.showURLPreview = ![URLPreviewService.shared hasClosedPreviewFrom:lastComponent.event];
if (!self.showURLPreview)
{
return;
@@ -1103,7 +1109,7 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
@"roomId": self.roomId
};
[URLPreviewManager.shared previewFor:lastComponent.link
[URLPreviewService.shared previewFor:lastComponent.link
and:lastComponent.event
with:self.mxSession
success:^(URLPreviewData * _Nonnull urlPreviewData) {