mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 09:20:08 +00:00
Various fixes
This commit is contained in:
parent
cdb156d253
commit
83d58dc5dd
@ -242,7 +242,7 @@ final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode,
|
|||||||
contentNodes.append(ActionSheetItemNode(theme: self.presentationData.theme, title: self.presentationData.strings.Conversation_SendMessage_SendSilently, icon: .sendWithoutSound, hasSeparator: true, action: {
|
contentNodes.append(ActionSheetItemNode(theme: self.presentationData.theme, title: self.presentationData.strings.Conversation_SendMessage_SendSilently, icon: .sendWithoutSound, hasSeparator: true, action: {
|
||||||
sendSilently?()
|
sendSilently?()
|
||||||
}))
|
}))
|
||||||
if canSendWhenOnline {
|
if canSendWhenOnline && schedule != nil {
|
||||||
contentNodes.append(ActionSheetItemNode(theme: self.presentationData.theme, title: self.presentationData.strings.Conversation_SendMessage_SendWhenOnline, icon: .sendWhenOnline, hasSeparator: true, action: {
|
contentNodes.append(ActionSheetItemNode(theme: self.presentationData.theme, title: self.presentationData.strings.Conversation_SendMessage_SendWhenOnline, icon: .sendWhenOnline, hasSeparator: true, action: {
|
||||||
sendWhenOnline?()
|
sendWhenOnline?()
|
||||||
}))
|
}))
|
||||||
|
|||||||
@ -270,6 +270,11 @@ public final class SecretMediaPreviewController: ViewController {
|
|||||||
self.controllerNode.dismiss = { [weak self] in
|
self.controllerNode.dismiss = { [weak self] in
|
||||||
self?._hiddenMedia.set(.single(nil))
|
self?._hiddenMedia.set(.single(nil))
|
||||||
self?.presentingViewController?.dismiss(animated: false, completion: nil)
|
self?.presentingViewController?.dismiss(animated: false, completion: nil)
|
||||||
|
|
||||||
|
if let tooltipController = self?.tooltipController {
|
||||||
|
self?.tooltipController = nil
|
||||||
|
tooltipController.dismiss()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.controllerNode.beginCustomDismiss = { [weak self] _ in
|
self.controllerNode.beginCustomDismiss = { [weak self] _ in
|
||||||
@ -443,6 +448,11 @@ public final class SecretMediaPreviewController: ViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func dismiss(forceAway: Bool) {
|
private func dismiss(forceAway: Bool) {
|
||||||
|
if let tooltipController = self.tooltipController {
|
||||||
|
self.tooltipController = nil
|
||||||
|
tooltipController.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
var animatedOutNode = true
|
var animatedOutNode = true
|
||||||
var animatedOutInterface = false
|
var animatedOutInterface = false
|
||||||
|
|
||||||
|
|||||||
@ -229,6 +229,9 @@ func presentLegacyMediaPickerGallery(context: AccountContext, peer: EnginePeer?,
|
|||||||
var effectiveHasSchedule = hasSchedule
|
var effectiveHasSchedule = hasSchedule
|
||||||
|
|
||||||
if let editingContext = editingContext {
|
if let editingContext = editingContext {
|
||||||
|
if let timer = editingContext.timer(for: item.asset)?.intValue, timer > 0 {
|
||||||
|
effectiveHasSchedule = false
|
||||||
|
}
|
||||||
for item in selectionContext.selectedItems() {
|
for item in selectionContext.selectedItems() {
|
||||||
if let editableItem = item as? TGMediaEditableItem, let timer = editingContext.timer(for: editableItem)?.intValue, timer > 0 {
|
if let editableItem = item as? TGMediaEditableItem, let timer = editingContext.timer(for: editableItem)?.intValue, timer > 0 {
|
||||||
effectiveHasSchedule = false
|
effectiveHasSchedule = false
|
||||||
@ -239,6 +242,9 @@ func presentLegacyMediaPickerGallery(context: AccountContext, peer: EnginePeer?,
|
|||||||
|
|
||||||
let sendWhenOnlineAvailable: Signal<Bool, NoError>
|
let sendWhenOnlineAvailable: Signal<Bool, NoError>
|
||||||
if let peer {
|
if let peer {
|
||||||
|
if case .secretChat = peer {
|
||||||
|
effectiveHasSchedule = false
|
||||||
|
}
|
||||||
sendWhenOnlineAvailable = context.account.viewTracker.peerView(peer.id)
|
sendWhenOnlineAvailable = context.account.viewTracker.peerView(peer.id)
|
||||||
|> take(1)
|
|> take(1)
|
||||||
|> map { peerView -> Bool in
|
|> map { peerView -> Bool in
|
||||||
@ -265,7 +271,7 @@ func presentLegacyMediaPickerGallery(context: AccountContext, peer: EnginePeer?,
|
|||||||
|> take(1)
|
|> take(1)
|
||||||
|> deliverOnMainQueue).start(next: { sendWhenOnlineAvailable in
|
|> deliverOnMainQueue).start(next: { sendWhenOnlineAvailable in
|
||||||
let legacySheetController = LegacyController(presentation: .custom, theme: presentationData.theme, initialLayout: nil)
|
let legacySheetController = LegacyController(presentation: .custom, theme: presentationData.theme, initialLayout: nil)
|
||||||
let sheetController = TGMediaPickerSendActionSheetController(context: legacyController.context, isDark: true, sendButtonFrame: model.interfaceView.doneButtonFrame, canSendSilently: hasSilentPosting, canSendWhenOnline: sendWhenOnlineAvailable, canSchedule: effectiveHasSchedule, reminder: reminder, hasTimer: false)
|
let sheetController = TGMediaPickerSendActionSheetController(context: legacyController.context, isDark: true, sendButtonFrame: model.interfaceView.doneButtonFrame, canSendSilently: hasSilentPosting, canSendWhenOnline: sendWhenOnlineAvailable && effectiveHasSchedule, canSchedule: effectiveHasSchedule, reminder: reminder, hasTimer: false)
|
||||||
let dismissImpl = { [weak model] in
|
let dismissImpl = { [weak model] in
|
||||||
model?.dismiss(true, false)
|
model?.dismiss(true, false)
|
||||||
dismissAll()
|
dismissAll()
|
||||||
|
|||||||
@ -1372,7 +1372,11 @@ final class MediaEditorScreenComponent: Component {
|
|||||||
self.addSubview(scrubberView)
|
self.addSubview(scrubberView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if animateIn {
|
||||||
|
scrubberView.frame = scrubberFrame
|
||||||
|
} else {
|
||||||
bottomControlsTransition.setFrame(view: scrubberView, frame: scrubberFrame)
|
bottomControlsTransition.setFrame(view: scrubberView, frame: scrubberFrame)
|
||||||
|
}
|
||||||
if !self.animatingButtons && !(isAudioOnly && animateIn) {
|
if !self.animatingButtons && !(isAudioOnly && animateIn) {
|
||||||
transition.setAlpha(view: scrubberView, alpha: component.isDisplayingTool || component.isDismissing || component.isInteractingWithEntities || isEditingCaption ? 0.0 : 1.0)
|
transition.setAlpha(view: scrubberView, alpha: component.isDisplayingTool || component.isDismissing || component.isInteractingWithEntities || isEditingCaption ? 0.0 : 1.0)
|
||||||
} else if animateIn {
|
} else if animateIn {
|
||||||
|
|||||||
@ -1158,7 +1158,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
|
|||||||
}
|
}
|
||||||
if isSecretMedia {
|
if isSecretMedia {
|
||||||
updateImageSignal = { synchronousLoad, _ in
|
updateImageSignal = { synchronousLoad, _ in
|
||||||
return chatSecretPhoto(account: context.account, userLocation: .peer(message.id.peerId), photoReference: .message(message: MessageReference(message), media: image))
|
return chatSecretPhoto(account: context.account, userLocation: .peer(message.id.peerId), photoReference: .message(message: MessageReference(message), media: image), ignoreFullSize: true)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
updateImageSignal = { synchronousLoad, highQuality in
|
updateImageSignal = { synchronousLoad, highQuality in
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user