From 61fd4320ca29812ce342ceac8191f9e1bac0d0c6 Mon Sep 17 00:00:00 2001 From: giomfo Date: Thu, 1 Dec 2016 14:55:29 +0100 Subject: [PATCH] MXKMediaManager has been moved to SDK level --- Vector/AppDelegate.m | 6 +++--- Vector/ViewController/RecentsViewController.m | 2 +- Vector/ViewController/RoomSettingsViewController.m | 4 ++-- Vector/ViewController/RoomViewController.m | 8 ++++---- Vector/ViewController/SettingsViewController.m | 2 +- Vector/Views/Search/FilesSearchTableViewCell.m | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Vector/AppDelegate.m b/Vector/AppDelegate.m index a5dbef841..90e3a570d 100644 --- a/Vector/AppDelegate.m +++ b/Vector/AppDelegate.m @@ -375,7 +375,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [[AFNetworkReachabilityManager sharedManager] stopMonitoring]; // check if some media must be released to reduce the cache size - [MXKMediaManager reduceCacheSizeToInsert:0]; + [MXMediaManager reduceCacheSizeToInsert:0]; // Hide potential notification if (self.mxInAppNotification) @@ -1516,7 +1516,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN if (clearCache) { // clear the media cache - [MXKMediaManager clearCache]; + [MXMediaManager clearCache]; } } @@ -1526,7 +1526,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN isAPNSRegistered = NO; // Clear cache - [MXKMediaManager clearCache]; + [MXMediaManager clearCache]; #ifdef MX_CALL_STACK_ENDPOINT // Erase all created certificates and private keys by MXEndpointCallStack diff --git a/Vector/ViewController/RecentsViewController.m b/Vector/ViewController/RecentsViewController.m index 5e05ddd56..3d9a906cf 100644 --- a/Vector/ViewController/RecentsViewController.m +++ b/Vector/ViewController/RecentsViewController.m @@ -553,7 +553,7 @@ // cancel pending uploads/downloads // they are useless by now - [MXKMediaManager cancelDownloadsInCacheFolder:room.state.roomId]; + [MXMediaManager cancelDownloadsInCacheFolder:room.state.roomId]; // TODO GFO cancel pending uploads related to this room diff --git a/Vector/ViewController/RoomSettingsViewController.m b/Vector/ViewController/RoomSettingsViewController.m index 201d724f3..0c1bc34d1 100644 --- a/Vector/ViewController/RoomSettingsViewController.m +++ b/Vector/ViewController/RoomSettingsViewController.m @@ -121,7 +121,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti UITextField* addAddressTextField; // The potential image loader - MXKMediaLoader *uploader; + MXMediaLoader *uploader; // The pending http operation MXHTTPOperation* pendingOperation; @@ -1044,7 +1044,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti UIImage *updatedPicture = [MXKTools forceImageOrientationUp:[updatedItemsDict objectForKey:kRoomSettingsAvatarKey]]; // Upload picture - uploader = [MXKMediaManager prepareUploaderWithMatrixSession:mxRoom.mxSession initialRange:0 andRange:1.0]; + uploader = [MXMediaManager prepareUploaderWithMatrixSession:mxRoom.mxSession initialRange:0 andRange:1.0]; [uploader uploadData:UIImageJPEGRepresentation(updatedPicture, 0.5) filename:nil mimeType:@"image/jpeg" success:^(NSString *url) { diff --git a/Vector/ViewController/RoomViewController.m b/Vector/ViewController/RoomViewController.m index 10e2b6266..bdc48e444 100644 --- a/Vector/ViewController/RoomViewController.m +++ b/Vector/ViewController/RoomViewController.m @@ -1789,7 +1789,7 @@ { // Upload id is stored in attachment url (nasty trick) NSString *uploadId = roomBubbleTableViewCell.bubbleData.attachment.actualURL; - if ([MXKMediaManager existingUploaderWithId:uploadId]) + if ([MXMediaManager existingUploaderWithId:uploadId]) { [currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_cancel_upload", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) { @@ -1797,7 +1797,7 @@ [strongSelf cancelEventSelection]; // Get again the loader - MXKMediaLoader *loader = [MXKMediaManager existingUploaderWithId:uploadId]; + MXMediaLoader *loader = [MXMediaManager existingUploaderWithId:uploadId]; if (loader) { [loader cancel]; @@ -1815,7 +1815,7 @@ if (level == 0 && selectedEvent.isMediaAttachment) { NSString *cacheFilePath = roomBubbleTableViewCell.bubbleData.attachment.cacheFilePath; - if ([MXKMediaManager existingDownloaderWithOutputFilePath:cacheFilePath]) + if ([MXMediaManager existingDownloaderWithOutputFilePath:cacheFilePath]) { [currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_cancel_download", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) { @@ -1823,7 +1823,7 @@ [strongSelf cancelEventSelection]; // Get again the loader - MXKMediaLoader *loader = [MXKMediaManager existingDownloaderWithOutputFilePath:cacheFilePath]; + MXMediaLoader *loader = [MXMediaManager existingDownloaderWithOutputFilePath:cacheFilePath]; if (loader) { [loader cancel]; diff --git a/Vector/ViewController/SettingsViewController.m b/Vector/ViewController/SettingsViewController.m index d9da68147..cb15788f1 100644 --- a/Vector/ViewController/SettingsViewController.m +++ b/Vector/ViewController/SettingsViewController.m @@ -1897,7 +1897,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); UIImage *updatedPicture = [MXKTools forceImageOrientationUp:newAvatarImage]; // Upload picture - MXKMediaLoader *uploader = [MXKMediaManager prepareUploaderWithMatrixSession:account.mxSession initialRange:0 andRange:1.0]; + MXMediaLoader *uploader = [MXMediaManager prepareUploaderWithMatrixSession:account.mxSession initialRange:0 andRange:1.0]; [uploader uploadData:UIImageJPEGRepresentation(updatedPicture, 0.5) filename:nil mimeType:@"image/jpeg" success:^(NSString *url) { diff --git a/Vector/Views/Search/FilesSearchTableViewCell.m b/Vector/Views/Search/FilesSearchTableViewCell.m index 2e68dd836..d8a5fa3db 100644 --- a/Vector/Views/Search/FilesSearchTableViewCell.m +++ b/Vector/Views/Search/FilesSearchTableViewCell.m @@ -80,8 +80,8 @@ UIImage *preview = nil; if (bubbleData.attachment.previewURL) { - NSString *cacheFilePath = [MXKMediaManager cachePathForMediaWithURL:bubbleData.attachment.previewURL andType:mimetype inFolder:self.attachmentImageView.mediaFolder]; - preview = [MXKMediaManager loadPictureFromFilePath:cacheFilePath]; + NSString *cacheFilePath = [MXMediaManager cachePathForMediaWithURL:bubbleData.attachment.previewURL andType:mimetype inFolder:self.attachmentImageView.mediaFolder]; + preview = [MXMediaManager loadPictureFromFilePath:cacheFilePath]; } if (url.length || preview)