mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 21:16:35 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
8466d0fbcc
@ -23,6 +23,26 @@ private func getFirstResponder(_ view: UIView) -> UIView? {
|
||||
}
|
||||
}
|
||||
|
||||
private func isViewVisibleInHierarchy(_ view: UIView, _ initial: Bool = true) -> Bool {
|
||||
guard let window = view.window else {
|
||||
return false
|
||||
}
|
||||
if view.isHidden || view.alpha == 0.0 {
|
||||
return false
|
||||
}
|
||||
if view.superview === window {
|
||||
return true
|
||||
} else if let superview = view.superview {
|
||||
if initial && view.frame.minY >= superview.frame.height {
|
||||
return false
|
||||
} else {
|
||||
return isViewVisibleInHierarchy(superview, false)
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
class KeyboardManager {
|
||||
private let host: StatusBarHost
|
||||
|
||||
@ -44,6 +64,9 @@ class KeyboardManager {
|
||||
guard let keyboardView = self.host.keyboardView else {
|
||||
return 0.0
|
||||
}
|
||||
if !isViewVisibleInHierarchy(keyboardView) {
|
||||
return 0.0
|
||||
}
|
||||
return keyboardView.bounds.height
|
||||
}
|
||||
|
||||
|
||||
@ -287,7 +287,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
if let result = result {
|
||||
if let result = result, strongSelf.scrubbingFrames {
|
||||
switch result {
|
||||
case .waitingForData:
|
||||
strongSelf.footerContentNode.setFramePreviewImageIsLoading()
|
||||
|
||||
@ -28,7 +28,13 @@ public func setSecretChatMessageAutoremoveTimeoutInteractively(account: Account,
|
||||
|
||||
public func addSecretChatMessageScreenshot(account: Account, peerId: PeerId) -> Signal<Void, NoError> {
|
||||
return account.postbox.transaction { transaction -> Void in
|
||||
if let peer = transaction.getPeer(peerId) as? TelegramSecretChat, let state = transaction.getPeerChatState(peerId) as? SecretChatState {
|
||||
if let _ = transaction.getPeer(peerId) as? TelegramSecretChat, let state = transaction.getPeerChatState(peerId) as? SecretChatState {
|
||||
switch state.embeddedState {
|
||||
case .handshake, .terminated:
|
||||
return
|
||||
default:
|
||||
break
|
||||
}
|
||||
let _ = enqueueMessages(transaction: transaction, account: account, peerId: peerId, messages: [(true, .message(text: "", attributes: [], mediaReference: .standalone(media: TelegramMediaAction(action: TelegramMediaActionType.historyScreenshot)), replyToMessageId: nil, localGroupingKey: nil))])
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user