This commit is contained in:
Ilya Laktyushin
2020-07-03 03:38:11 +03:00
parent 04ba76c7e6
commit cb2952cbf0
61 changed files with 3 additions and 8537 deletions

View File

@@ -12,11 +12,9 @@
#import "TGAttachmentCarouselItemView.h"
#import <LegacyComponents/TGCameraController.h>
#import "TGLegacyCameraController.h"
#import <LegacyComponents/TGImagePickerController.h>
#import <LegacyComponents/TGMediaAssetsController.h>
@interface TGMediaAvatarMenuMixin () <TGLegacyCameraControllerDelegate>
@interface TGMediaAvatarMenuMixin ()
{
TGViewController *_parentController;
bool _hasSearchButton;
@@ -278,13 +276,6 @@
if ([_context currentlyInSplitView])
return;
if ([TGCameraController useLegacyCamera])
{
[self _displayLegacyCamera];
[menuController dismissAnimated:true];
return;
}
TGCameraController *controller = nil;
CGSize screenSize = TGScreenSize();
@@ -376,16 +367,6 @@
};
}
- (void)_displayLegacyCamera
{
TGLegacyCameraController *legacyCameraController = [[TGLegacyCameraController alloc] initWithContext:_context];
legacyCameraController.sourceType = UIImagePickerControllerSourceTypeCamera;
legacyCameraController.avatarMode = true;
legacyCameraController.completionDelegate = self;
[_parentController presentViewController:legacyCameraController animated:true completion:nil];
}
- (void)_displayMediaPicker
{
if (![[[LegacyComponentsGlobals provider] accessChecker] checkPhotoAuthorizationStatusForIntent:TGPhotoAccessIntentRead alertDismissCompletion:nil])
@@ -531,30 +512,6 @@
}
}
- (void)imagePickerController:(TGImagePickerController *)__unused imagePicker didFinishPickingWithAssets:(NSArray *)assets
{
UIImage *resultImage = nil;
if (assets.count != 0)
{
if ([assets[0] isKindOfClass:[UIImage class]])
resultImage = assets[0];
}
if (self.didFinishWithImage != nil)
self.didFinishWithImage(resultImage);
[_parentController dismissViewControllerAnimated:true completion:nil];
}
- (void)legacyCameraControllerCompletedWithNoResult
{
[_parentController dismissViewControllerAnimated:true completion:nil];
if (self.didDismiss != nil)
self.didDismiss();
}
- (void)_performDelete
{
if (self.didFinishWithDelete != nil)