Merge pull request #848 from vector-im/move_media_loader

MXKMediaManager has been moved to SDK level
This commit is contained in:
giomfo 2016-12-01 15:53:29 +01:00 committed by GitHub
commit 6530fad70a
6 changed files with 13 additions and 13 deletions

View file

@ -375,7 +375,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
[[AFNetworkReachabilityManager sharedManager] stopMonitoring]; [[AFNetworkReachabilityManager sharedManager] stopMonitoring];
// check if some media must be released to reduce the cache size // check if some media must be released to reduce the cache size
[MXKMediaManager reduceCacheSizeToInsert:0]; [MXMediaManager reduceCacheSizeToInsert:0];
// Hide potential notification // Hide potential notification
if (self.mxInAppNotification) if (self.mxInAppNotification)
@ -1516,7 +1516,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
if (clearCache) if (clearCache)
{ {
// clear the media cache // clear the media cache
[MXKMediaManager clearCache]; [MXMediaManager clearCache];
} }
} }
@ -1526,7 +1526,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
isAPNSRegistered = NO; isAPNSRegistered = NO;
// Clear cache // Clear cache
[MXKMediaManager clearCache]; [MXMediaManager clearCache];
#ifdef MX_CALL_STACK_ENDPOINT #ifdef MX_CALL_STACK_ENDPOINT
// Erase all created certificates and private keys by MXEndpointCallStack // Erase all created certificates and private keys by MXEndpointCallStack

View file

@ -553,7 +553,7 @@
// cancel pending uploads/downloads // cancel pending uploads/downloads
// they are useless by now // they are useless by now
[MXKMediaManager cancelDownloadsInCacheFolder:room.state.roomId]; [MXMediaManager cancelDownloadsInCacheFolder:room.state.roomId];
// TODO GFO cancel pending uploads related to this room // TODO GFO cancel pending uploads related to this room

View file

@ -121,7 +121,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
UITextField* addAddressTextField; UITextField* addAddressTextField;
// The potential image loader // The potential image loader
MXKMediaLoader *uploader; MXMediaLoader *uploader;
// The pending http operation // The pending http operation
MXHTTPOperation* pendingOperation; MXHTTPOperation* pendingOperation;
@ -1044,7 +1044,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
UIImage *updatedPicture = [MXKTools forceImageOrientationUp:[updatedItemsDict objectForKey:kRoomSettingsAvatarKey]]; UIImage *updatedPicture = [MXKTools forceImageOrientationUp:[updatedItemsDict objectForKey:kRoomSettingsAvatarKey]];
// Upload picture // 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) { [uploader uploadData:UIImageJPEGRepresentation(updatedPicture, 0.5) filename:nil mimeType:@"image/jpeg" success:^(NSString *url) {

View file

@ -1789,7 +1789,7 @@
{ {
// Upload id is stored in attachment url (nasty trick) // Upload id is stored in attachment url (nasty trick)
NSString *uploadId = roomBubbleTableViewCell.bubbleData.attachment.actualURL; 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) { [currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_cancel_upload", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
@ -1797,7 +1797,7 @@
[strongSelf cancelEventSelection]; [strongSelf cancelEventSelection];
// Get again the loader // Get again the loader
MXKMediaLoader *loader = [MXKMediaManager existingUploaderWithId:uploadId]; MXMediaLoader *loader = [MXMediaManager existingUploaderWithId:uploadId];
if (loader) if (loader)
{ {
[loader cancel]; [loader cancel];
@ -1815,7 +1815,7 @@
if (level == 0 && selectedEvent.isMediaAttachment) if (level == 0 && selectedEvent.isMediaAttachment)
{ {
NSString *cacheFilePath = roomBubbleTableViewCell.bubbleData.attachment.cacheFilePath; 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) { [currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_cancel_download", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
@ -1823,7 +1823,7 @@
[strongSelf cancelEventSelection]; [strongSelf cancelEventSelection];
// Get again the loader // Get again the loader
MXKMediaLoader *loader = [MXKMediaManager existingDownloaderWithOutputFilePath:cacheFilePath]; MXMediaLoader *loader = [MXMediaManager existingDownloaderWithOutputFilePath:cacheFilePath];
if (loader) if (loader)
{ {
[loader cancel]; [loader cancel];

View file

@ -1897,7 +1897,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
UIImage *updatedPicture = [MXKTools forceImageOrientationUp:newAvatarImage]; UIImage *updatedPicture = [MXKTools forceImageOrientationUp:newAvatarImage];
// Upload picture // 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) { [uploader uploadData:UIImageJPEGRepresentation(updatedPicture, 0.5) filename:nil mimeType:@"image/jpeg" success:^(NSString *url) {

View file

@ -80,8 +80,8 @@
UIImage *preview = nil; UIImage *preview = nil;
if (bubbleData.attachment.previewURL) if (bubbleData.attachment.previewURL)
{ {
NSString *cacheFilePath = [MXKMediaManager cachePathForMediaWithURL:bubbleData.attachment.previewURL andType:mimetype inFolder:self.attachmentImageView.mediaFolder]; NSString *cacheFilePath = [MXMediaManager cachePathForMediaWithURL:bubbleData.attachment.previewURL andType:mimetype inFolder:self.attachmentImageView.mediaFolder];
preview = [MXKMediaManager loadPictureFromFilePath:cacheFilePath]; preview = [MXMediaManager loadPictureFromFilePath:cacheFilePath];
} }
if (url.length || preview) if (url.length || preview)