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:
Doug
2021-09-01 12:28:56 +01:00
parent 4331994d72
commit 882fcab738
15 changed files with 217 additions and 210 deletions
+1 -5
View File
@@ -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];
}
}