mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
Check whether URL previews should be shown in a single location.
Reset all cell data when this setting is changed to force a refresh. Rename `hasClosedPreview(from:)` to `shouldShowPreview(for:)` for clarity and potentially adding more rules at a later date.
This commit is contained in:
@@ -731,11 +731,6 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
|
||||
|
||||
- (MXKRoomBubbleComponent *)bubbleComponentWithLinkForEventId:(NSString *)eventId
|
||||
{
|
||||
if (!RiotSettings.shared.roomScreenShowsURLPreviews)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSInteger index = [self bubbleComponentIndexForEventId:eventId];
|
||||
if (index == NSNotFound)
|
||||
{
|
||||
@@ -1085,8 +1080,8 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't show the preview if it has been dismissed already.
|
||||
component.showURLPreview = ![URLPreviewService.shared hasClosedPreviewFrom:component.event];
|
||||
// Don't show the preview if they're disabled globally or this one has been dismissed previously.
|
||||
component.showURLPreview = RiotSettings.shared.roomScreenShowsURLPreviews && [URLPreviewService.shared shouldShowPreviewFor:component.event];
|
||||
if (!component.showURLPreview)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user