mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
compability of photo library with previous linphone version
This commit is contained in:
parent
db6dccbcd4
commit
52d83cc40e
4 changed files with 15 additions and 3 deletions
|
|
@ -157,6 +157,7 @@ typedef struct _LinphoneManagerSounds {
|
|||
- (void)configureVbrCodecs;
|
||||
|
||||
+ (BOOL)copyFile:(NSString*)src destination:(NSString*)dst override:(BOOL)override;
|
||||
+ (PHFetchResult *)getPHAssets:(NSString *)key;
|
||||
+ (NSString*)bundleFile:(NSString*)file;
|
||||
+ (NSString*)documentFile:(NSString*)file;
|
||||
+ (NSString*)cacheDirectory;
|
||||
|
|
|
|||
|
|
@ -2844,6 +2844,16 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
}
|
||||
|
||||
#pragma mark - Misc Functions
|
||||
+ (PHFetchResult *)getPHAssets:(NSString *)key {
|
||||
PHFetchResult<PHAsset *> *assets;
|
||||
if ([key hasPrefix:@"assets-library"]) {
|
||||
// compability with previous linphone version
|
||||
assets = [PHAsset fetchAssetsWithALAssetURLs:@[[NSURL URLWithString:key]] options:nil];
|
||||
} else {
|
||||
assets = [PHAsset fetchAssetsWithLocalIdentifiers:[NSArray arrayWithObject:key] options:nil];
|
||||
}
|
||||
return assets;
|
||||
}
|
||||
|
||||
+ (NSString *)bundleFile:(NSString *)file {
|
||||
return [[NSBundle mainBundle] pathForResource:[file stringByDeletingPathExtension] ofType:[file pathExtension]];
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@
|
|||
|
||||
- (void)loadFirstImage:(NSString *)key type:(PHAssetMediaType)type {
|
||||
[_messageImageView startLoading];
|
||||
PHFetchResult<PHAsset *> *assets = [PHAsset fetchAssetsWithLocalIdentifiers:[NSArray arrayWithObject:key] options:nil];
|
||||
PHFetchResult<PHAsset *> *assets = [LinphoneManager getPHAssets:key];
|
||||
UIImage *img = nil;
|
||||
|
||||
img = [chatTableView.imagesInChatroom objectForKey:key];
|
||||
|
|
|
|||
|
|
@ -333,7 +333,8 @@
|
|||
[_chatRoomDelegate startImageUpload:img assetId:localImage withQuality:(uploadQuality ? [uploadQuality floatValue] : 0.9)];
|
||||
});
|
||||
} else {
|
||||
PHFetchResult<PHAsset *> *assets = [PHAsset fetchAssetsWithLocalIdentifiers:[NSArray arrayWithObject:localImage] options:nil];
|
||||
PHFetchResult<PHAsset *> *assets = [LinphoneManager getPHAssets:localImage];
|
||||
|
||||
if (![assets firstObject])
|
||||
return;
|
||||
PHAsset *asset = [assets firstObject];
|
||||
|
|
@ -505,7 +506,7 @@ static const CGFloat CELL_MESSAGE_Y_MARGIN = 44; // 44;
|
|||
}
|
||||
PHFetchResult<PHAsset *> *assets;
|
||||
if(localImage)
|
||||
assets = [PHAsset fetchAssetsWithLocalIdentifiers:[NSArray arrayWithObject:localImage] options:nil];
|
||||
assets = [LinphoneManager getPHAssets:localImage];
|
||||
else
|
||||
assets = [PHAsset fetchAssetsWithLocalIdentifiers:[NSArray arrayWithObject:localVideo] options:nil];
|
||||
if (![assets firstObject]) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue