mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +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:
@@ -31,7 +31,7 @@
|
||||
@protocol LegacyAppDelegateDelegate;
|
||||
@class CallBar;
|
||||
@class CallPresenter;
|
||||
@class PreviewManager;
|
||||
@class URLPreviewManager;
|
||||
|
||||
#pragma mark - Notifications
|
||||
/**
|
||||
@@ -105,9 +105,6 @@ UINavigationControllerDelegate
|
||||
// Associated matrix sessions (empty by default).
|
||||
@property (nonatomic, readonly) NSArray *mxSessions;
|
||||
|
||||
#warning Move this elsewhere.
|
||||
@property (nonatomic, readonly) PreviewManager *previewManager;
|
||||
|
||||
// Current selected room id. nil if no room is presently visible.
|
||||
@property (strong, nonatomic) NSString *visibleRoomId;
|
||||
|
||||
|
||||
@@ -548,7 +548,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
[MXMediaManager reduceCacheSizeToInsert:0];
|
||||
|
||||
// Remove expired URL previews from the cache
|
||||
[self.previewManager removeExpiredItemsFromCache];
|
||||
[URLPreviewManager.shared removeExpiredCacheData];
|
||||
|
||||
// Hide potential notification
|
||||
if (self.mxInAppNotification)
|
||||
@@ -1983,10 +1983,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
[self checkDeviceId:mxSession];
|
||||
|
||||
[self.delegate legacyAppDelegate:self didAddMatrixSession:mxSession];
|
||||
|
||||
#warning Move this elsewhere
|
||||
self->_previewManager = [[PreviewManager alloc] initWithRestClient:mxSession.matrixRestClient
|
||||
mediaManager:mxSession.mediaManager];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user