Merge commit 'ed5f2636aae56207389ed5e04a1fe9d7b3d1c787'

This commit is contained in:
Ali 2022-05-02 16:41:02 +04:00
commit 69d60af5aa
9 changed files with 28 additions and 16 deletions

View File

@ -1365,7 +1365,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
currentSecretIconImage = PresentationResourcesChatList.secretIcon(item.presentationData.theme) currentSecretIconImage = PresentationResourcesChatList.secretIcon(item.presentationData.theme)
} }
var credibilityIconOffset: CGFloat = 0.0 var credibilityIconOffset: CGFloat = 0.0
if !isPeerGroup {
if !isPeerGroup && item.index.messageIndex.id.peerId != item.context.account.peerId {
if displayAsMessage { if displayAsMessage {
switch item.content { switch item.content {
case let .peer(messages, _, _, _, _, _, _, _, _, _, _, _, _): case let .peer(messages, _, _, _, _, _, _, _, _, _, _, _, _):

View File

@ -470,8 +470,15 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
}) })
} else { } else {
if let fromValue = fromValue { if let fromValue = fromValue {
if viewTreeContainsFirstResponder(view: fromValue.value.view) {
self.ignoreInputHeight = true
}
fromValue.value.viewWillLeaveNavigation() fromValue.value.viewWillLeaveNavigation()
fromValue.value.viewWillDisappear(false) fromValue.value.viewWillDisappear(false)
self.keyboardViewManager?.dismissEditingWithoutAnimation(view: fromValue.value.view)
fromValue.value.setIgnoreAppearanceMethodInvocations(true) fromValue.value.setIgnoreAppearanceMethodInvocations(true)
fromValue.value.displayNode.removeFromSupernode() fromValue.value.displayNode.removeFromSupernode()
fromValue.value.setIgnoreAppearanceMethodInvocations(false) fromValue.value.setIgnoreAppearanceMethodInvocations(false)
@ -487,6 +494,7 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
toValue.value.displayNode.recursivelyEnsureDisplaySynchronously(true) toValue.value.displayNode.recursivelyEnsureDisplaySynchronously(true)
toValue.value.viewDidAppear(false) toValue.value.viewDidAppear(false)
} }
self.ignoreInputHeight = false
} }
} }

View File

@ -60,7 +60,7 @@ typedef enum {
- (id<LegacyComponentsAccessChecker>)accessChecker; - (id<LegacyComponentsAccessChecker>)accessChecker;
- (id<SDisposable>)requestAudioSession:(TGAudioSessionType)type interrupted:(void (^)())interrupted; - (id<SDisposable>)requestAudioSession:(TGAudioSessionType)type activated:(void (^)())activated interrupted:(void (^)())interrupted;
- (SThreadPool *)sharedMediaImageProcessingThreadPool; - (SThreadPool *)sharedMediaImageProcessingThreadPool;
- (TGMemoryImageCache *)sharedMediaMemoryImageCache; - (TGMemoryImageCache *)sharedMediaMemoryImageCache;

View File

@ -367,7 +367,7 @@ const NSInteger PGCameraFrameRate = 30;
_hasAudioSession = true; _hasAudioSession = true;
[_audioSessionQueue dispatchSync:^ [_audioSessionQueue dispatchSync:^
{ {
[_currentAudioSession setDisposable:[[LegacyComponentsGlobals provider] requestAudioSession:TGAudioSessionTypePlayAndRecord interrupted:nil]]; [_currentAudioSession setDisposable:[[LegacyComponentsGlobals provider] requestAudioSession:TGAudioSessionTypePlayAndRecord activated:nil interrupted:nil]];
}]; }];
} }

View File

@ -1120,7 +1120,7 @@
__weak TGMediaPickerGalleryVideoItemView *weakSelf = self; __weak TGMediaPickerGalleryVideoItemView *weakSelf = self;
[[SQueue concurrentDefaultQueue] dispatch:^ [[SQueue concurrentDefaultQueue] dispatch:^
{ {
[_currentAudioSession setDisposable:[[LegacyComponentsGlobals provider] requestAudioSession:TGAudioSessionTypePlayVideo interrupted:^ [_currentAudioSession setDisposable:[[LegacyComponentsGlobals provider] requestAudioSession:TGAudioSessionTypePlayVideo activated:nil interrupted:^
{ {
TGDispatchOnMainThread(^ TGDispatchOnMainThread(^
{ {

View File

@ -919,9 +919,6 @@ static CGFloat angleOffsetFromPortraitOrientationToOrientation(AVCaptureVideoOri
if (![device respondsToSelector:@selector(setVideoZoomFactor:)]) if (![device respondsToSelector:@selector(setVideoZoomFactor:)])
return false; return false;
if (device.position == AVCaptureDevicePositionFront)
return false;
return true; return true;
} }

View File

@ -572,10 +572,6 @@ typedef enum
[self _transitionIn]; [self _transitionIn];
[self _beginAudioSession:false]; [self _beginAudioSession:false];
[_queue dispatch:^
{
[_capturePipeline startRunning];
}];
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
@ -1308,7 +1304,16 @@ typedef enum
_otherAudioPlaying = [[AVAudioSession sharedInstance] isOtherAudioPlaying]; _otherAudioPlaying = [[AVAudioSession sharedInstance] isOtherAudioPlaying];
__weak TGVideoMessageCaptureController *weakSelf = self; __weak TGVideoMessageCaptureController *weakSelf = self;
id<SDisposable> disposable = [[LegacyComponentsGlobals provider] requestAudioSession:speaker ? TGAudioSessionTypePlayAndRecordHeadphones : TGAudioSessionTypePlayAndRecord interrupted:^ id<SDisposable> disposable = [[LegacyComponentsGlobals provider] requestAudioSession:speaker ? TGAudioSessionTypePlayAndRecordHeadphones : TGAudioSessionTypePlayAndRecord
activated:^{
__strong TGVideoMessageCaptureController *strongSelf = weakSelf;
if (strongSelf != nil) {
[strongSelf->_queue dispatch:^
{
[strongSelf->_capturePipeline startRunning];
}];
}
} interrupted:^
{ {
TGDispatchOnMainThread(^{ TGDispatchOnMainThread(^{
__strong TGVideoMessageCaptureController *strongSelf = weakSelf; __strong TGVideoMessageCaptureController *strongSelf = weakSelf;

View File

@ -177,7 +177,7 @@ private final class LegacyComponentsGlobalsProviderImpl: NSObject, LegacyCompone
return LegacyComponentsAccessCheckerImpl(context: legacyContext) return LegacyComponentsAccessCheckerImpl(context: legacyContext)
} }
public func request(_ type: TGAudioSessionType, interrupted: (() -> Void)!) -> SDisposable! { public func request(_ type: TGAudioSessionType, activated: (() -> Void)!, interrupted: (() -> Void)!) -> SDisposable! {
if let legacyContext = legacyContext { if let legacyContext = legacyContext {
let convertedType: ManagedAudioSessionType let convertedType: ManagedAudioSessionType
switch type { switch type {
@ -187,6 +187,7 @@ private final class LegacyComponentsGlobalsProviderImpl: NSObject, LegacyCompone
convertedType = .play convertedType = .play
} }
let disposable = legacyContext.sharedContext.mediaManager.audioSession.push(audioSessionType: convertedType, once: true, activate: { _ in let disposable = legacyContext.sharedContext.mediaManager.audioSession.push(audioSessionType: convertedType, once: true, activate: { _ in
activated?()
}, deactivate: { _ in }, deactivate: { _ in
interrupted?() interrupted?()
return .complete() return .complete()

View File

@ -177,8 +177,8 @@ private final class StickerPackContainer: ASDisplayNode {
self.addSubnode(self.backgroundNode) self.addSubnode(self.backgroundNode)
self.addSubnode(self.gridNode) self.addSubnode(self.gridNode)
// self.addSubnode(self.actionAreaBackgroundNode) self.addSubnode(self.actionAreaBackgroundNode)
// self.addSubnode(self.actionAreaSeparatorNode) self.addSubnode(self.actionAreaSeparatorNode)
self.addSubnode(self.buttonNode) self.addSubnode(self.buttonNode)
self.addSubnode(self.titleBackgroundnode) self.addSubnode(self.titleBackgroundnode)