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:
Doug
2021-09-29 11:39:11 +01:00
parent 518d108573
commit 522f4e800c
4 changed files with 9 additions and 11 deletions
@@ -92,9 +92,9 @@ class URLPreviewService: NSObject {
store.closePreview(for: eventId, in: roomId)
}
/// Whether a preview for the given event has been closed or not.
func hasClosedPreview(from event: MXEvent) -> Bool {
store.hasClosedPreview(for: event.eventId, in: event.roomId)
/// Whether a preview for the given event should be shown or not.
func shouldShowPreview(for event: MXEvent) -> Bool {
!store.hasClosedPreview(for: event.eventId, in: event.roomId)
}
// MARK: - Private