mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Refactoring and tidy up.
Make the preview manager a singleton (passing in the MXSession to functions). Fix tests. PreviewManager → URLPreviewManager URLPreviewViewData → URLPreviewData URLPreviewCache → URLPreviewStore
This commit is contained in:
@@ -1071,7 +1071,7 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
|
||||
}
|
||||
|
||||
// Check that the preview hasn't been dismissed already.
|
||||
if ([LegacyAppDelegate.theDelegate.previewManager hasClosedPreviewFrom:lastComponent.event])
|
||||
if ([URLPreviewManager.shared hasClosedPreviewFrom:lastComponent.event])
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1079,7 +1079,10 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
|
||||
// Set the preview data.
|
||||
MXWeakify(self);
|
||||
|
||||
[LegacyAppDelegate.theDelegate.previewManager previewFor:lastComponent.link and:lastComponent.event success:^(URLPreviewViewData * _Nonnull urlPreviewData) {
|
||||
[URLPreviewManager.shared previewFor:lastComponent.link
|
||||
and:lastComponent.event
|
||||
with:self.mxSession
|
||||
success:^(URLPreviewData * _Nonnull urlPreviewData) {
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
// Update the preview data and send a notification for refresh
|
||||
|
||||
Reference in New Issue
Block a user