mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 13:35:19 +00:00
Various fixes
This commit is contained in:
parent
3b7ddc33ee
commit
e5762bd9c8
@ -14333,3 +14333,6 @@ Sorry for the inconvenience.";
|
|||||||
"ChatbotSetup.Gift.Warning.StarsText" = "The bot **%@** will be able to **transfer your stars**.";
|
"ChatbotSetup.Gift.Warning.StarsText" = "The bot **%@** will be able to **transfer your stars**.";
|
||||||
"ChatbotSetup.Gift.Warning.UsernameText" = "The bot **%@** will be able to **set and remove usernames** for your account, which may result in the loss of your current username.";
|
"ChatbotSetup.Gift.Warning.UsernameText" = "The bot **%@** will be able to **set and remove usernames** for your account, which may result in the loss of your current username.";
|
||||||
"ChatbotSetup.Gift.Warning.Proceed" = "Proceed";
|
"ChatbotSetup.Gift.Warning.Proceed" = "Proceed";
|
||||||
|
|
||||||
|
"Gift.Buy.ErrorTooEarly.Title" = "Try Later";
|
||||||
|
"Gift.Buy.ErrorTooEarly.Text" = "You will be able to buy this gift on %@.";
|
||||||
|
@ -338,8 +338,13 @@ final class ChatSendMessageContextScreenComponent: Component {
|
|||||||
guard let animateInTimestamp = self.animateInTimestamp, animateInTimestamp < CFAbsoluteTimeGetCurrent() - 0.35 else {
|
guard let animateInTimestamp = self.animateInTimestamp, animateInTimestamp < CFAbsoluteTimeGetCurrent() - 0.35 else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let localPoint: CGPoint
|
||||||
actionsStackNode.highlightGestureMoved(location: actionsStackNode.view.convert(location, from: view))
|
if let metrics = self.environment?.metrics, metrics.isTablet, availableSize.width > availableSize.height, let view {
|
||||||
|
localPoint = view.convert(location, to: nil)
|
||||||
|
} else {
|
||||||
|
localPoint = self.convert(location, from: view)
|
||||||
|
}
|
||||||
|
actionsStackNode.highlightGestureMoved(location: self.convert(localPoint, to: actionsStackNode.view))
|
||||||
}
|
}
|
||||||
component.gesture.externalEnded = { [weak self] viewAndLocation in
|
component.gesture.externalEnded = { [weak self] viewAndLocation in
|
||||||
guard let self, let actionsStackNode = self.actionsStackNode else {
|
guard let self, let actionsStackNode = self.actionsStackNode else {
|
||||||
|
@ -109,6 +109,7 @@ public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
|||||||
|
|
||||||
public var onInteractionUpdated: (Bool) -> Void = { _ in }
|
public var onInteractionUpdated: (Bool) -> Void = { _ in }
|
||||||
public var edgePreviewUpdated: (Bool) -> Void = { _ in }
|
public var edgePreviewUpdated: (Bool) -> Void = { _ in }
|
||||||
|
public var onTextEditingEnded: (Bool) -> Void = { _ in }
|
||||||
|
|
||||||
private let hapticFeedback = HapticFeedback()
|
private let hapticFeedback = HapticFeedback()
|
||||||
|
|
||||||
|
@ -3078,6 +3078,11 @@ public final class DrawingToolsInteraction {
|
|||||||
self.onInteractionUpdated(isInteracting)
|
self.onInteractionUpdated(isInteracting)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.entitiesView.onTextEditingEnded = { [weak self] reset in
|
||||||
|
if let self {
|
||||||
|
self.onTextEditingEnded(reset)
|
||||||
|
}
|
||||||
|
}
|
||||||
self.entitiesView.requestedMenuForEntityView = { [weak self] entityView, isTopmost in
|
self.entitiesView.requestedMenuForEntityView = { [weak self] entityView, isTopmost in
|
||||||
guard let self, let node = self.getControllerNode() else {
|
guard let self, let node = self.getControllerNode() else {
|
||||||
return
|
return
|
||||||
@ -3267,7 +3272,6 @@ public final class DrawingToolsInteraction {
|
|||||||
public func endTextEditing(reset: Bool) {
|
public func endTextEditing(reset: Bool) {
|
||||||
if let entityView = self.entitiesView.selectedEntityView as? DrawingTextEntityView {
|
if let entityView = self.entitiesView.selectedEntityView as? DrawingTextEntityView {
|
||||||
entityView.endEditing(reset: reset)
|
entityView.endEditing(reset: reset)
|
||||||
self.onTextEditingEnded(reset)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,6 +357,8 @@ public final class DrawingTextEntityView: DrawingEntityView, UITextViewDelegate
|
|||||||
selectionView.alpha = 1.0
|
selectionView.alpha = 1.0
|
||||||
selectionView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
selectionView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parentView.onTextEditingEnded(reset)
|
||||||
}
|
}
|
||||||
|
|
||||||
func suspendEditing() {
|
func suspendEditing() {
|
||||||
|
@ -1539,8 +1539,10 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
|
|||||||
strongSelf.videoNode?.playOnceWithSound(playAndRecord: false, seek: .none, actionAtEnd: isAnimated ? .loop : strongSelf.actionAtEnd)
|
strongSelf.videoNode?.playOnceWithSound(playAndRecord: false, seek: .none, actionAtEnd: isAnimated ? .loop : strongSelf.actionAtEnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let playbackRate = strongSelf.playbackRate {
|
Queue.mainQueue().after(0.1) {
|
||||||
strongSelf.videoNode?.setBaseRate(playbackRate)
|
if let playbackRate = strongSelf.playbackRate {
|
||||||
|
strongSelf.videoNode?.setBaseRate(playbackRate)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,7 @@ public enum BotPaymentFormRequestError {
|
|||||||
case alreadyActive
|
case alreadyActive
|
||||||
case noPaymentNeeded
|
case noPaymentNeeded
|
||||||
case disallowedStarGift
|
case disallowedStarGift
|
||||||
|
case starGiftResellTooEarly(Int32)
|
||||||
}
|
}
|
||||||
|
|
||||||
extension BotPaymentInvoice {
|
extension BotPaymentInvoice {
|
||||||
@ -482,6 +483,11 @@ func _internal_fetchBotPaymentForm(accountPeerId: PeerId, postbox: Postbox, netw
|
|||||||
return .fail(.noPaymentNeeded)
|
return .fail(.noPaymentNeeded)
|
||||||
} else if error.errorDescription == "USER_DISALLOWED_STARGIFTS" {
|
} else if error.errorDescription == "USER_DISALLOWED_STARGIFTS" {
|
||||||
return .fail(.disallowedStarGift)
|
return .fail(.disallowedStarGift)
|
||||||
|
} else if error.errorDescription.hasPrefix("STARGIFT_RESELL_TOO_EARLY_") {
|
||||||
|
let timeout = String(error.errorDescription[error.errorDescription.index(error.errorDescription.startIndex, offsetBy: "STARGIFT_RESELL_TOO_EARLY_".count)...])
|
||||||
|
if let value = Int32(timeout) {
|
||||||
|
return .fail(.starGiftResellTooEarly(value))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return .fail(.generic)
|
return .fail(.generic)
|
||||||
}
|
}
|
||||||
|
@ -855,6 +855,7 @@ public enum TransferStarGiftError {
|
|||||||
public enum BuyStarGiftError {
|
public enum BuyStarGiftError {
|
||||||
case generic
|
case generic
|
||||||
case priceChanged(Int64)
|
case priceChanged(Int64)
|
||||||
|
case starGiftResellTooEarly(Int32)
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum UpdateStarGiftPriceError {
|
public enum UpdateStarGiftPriceError {
|
||||||
@ -871,6 +872,9 @@ func _internal_buyStarGift(account: Account, slug: String, peerId: EnginePeer.Id
|
|||||||
return _internal_fetchBotPaymentForm(accountPeerId: account.peerId, postbox: account.postbox, network: account.network, source: source, themeParams: nil)
|
return _internal_fetchBotPaymentForm(accountPeerId: account.peerId, postbox: account.postbox, network: account.network, source: source, themeParams: nil)
|
||||||
|> map(Optional.init)
|
|> map(Optional.init)
|
||||||
|> `catch` { error -> Signal<BotPaymentForm?, BuyStarGiftError> in
|
|> `catch` { error -> Signal<BotPaymentForm?, BuyStarGiftError> in
|
||||||
|
if case let .starGiftResellTooEarly(timestamp) = error {
|
||||||
|
return .fail(.starGiftResellTooEarly(timestamp))
|
||||||
|
}
|
||||||
return .fail(.generic)
|
return .fail(.generic)
|
||||||
}
|
}
|
||||||
|> mapToSignal { paymentForm in
|
|> mapToSignal { paymentForm in
|
||||||
|
@ -107,6 +107,7 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||||||
var buyForm: BotPaymentForm?
|
var buyForm: BotPaymentForm?
|
||||||
var buyFormDisposable: Disposable?
|
var buyFormDisposable: Disposable?
|
||||||
var buyDisposable: Disposable?
|
var buyDisposable: Disposable?
|
||||||
|
var resellTooEarlyTimestamp: Int32?
|
||||||
|
|
||||||
var inWearPreview = false
|
var inWearPreview = false
|
||||||
var pendingWear = false
|
var pendingWear = false
|
||||||
@ -180,6 +181,14 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||||||
}
|
}
|
||||||
self.buyForm = paymentForm
|
self.buyForm = paymentForm
|
||||||
self.updated()
|
self.updated()
|
||||||
|
}, error: { [weak self] error in
|
||||||
|
guard let self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if case let .starGiftResellTooEarly(remaining) = error {
|
||||||
|
let currentTime = Int32(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970)
|
||||||
|
self.resellTooEarlyTimestamp = currentTime + remaining
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else if case let .generic(gift) = arguments.gift {
|
} else if case let .generic(gift) = arguments.gift {
|
||||||
@ -871,7 +880,7 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||||||
title = nil
|
title = nil
|
||||||
text = presentationData.strings.Gift_Send_ErrorUnknown
|
text = presentationData.strings.Gift_Send_ErrorUnknown
|
||||||
case let .starGiftResellTooEarly(canResaleDate):
|
case let .starGiftResellTooEarly(canResaleDate):
|
||||||
let dateString = stringForFullDate(timestamp: canResaleDate, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat)
|
let dateString = stringForFullDate(timestamp: currentTime + canResaleDate, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat)
|
||||||
title = presentationData.strings.Gift_Resale_Unavailable_Title
|
title = presentationData.strings.Gift_Resale_Unavailable_Title
|
||||||
text = presentationData.strings.Gift_Resale_Unavailable_Text(dateString).string
|
text = presentationData.strings.Gift_Resale_Unavailable_Text(dateString).string
|
||||||
}
|
}
|
||||||
@ -1150,10 +1159,28 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let giftTitle = "\(uniqueGift.title) #\(uniqueGift.number)"
|
|
||||||
|
|
||||||
let context = self.context
|
let context = self.context
|
||||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||||
|
|
||||||
|
if let resellTooEarlyTimestamp = self.resellTooEarlyTimestamp {
|
||||||
|
guard let controller = self.getController() else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let dateString = stringForFullDate(timestamp: resellTooEarlyTimestamp, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat)
|
||||||
|
let alertController = textAlertController(
|
||||||
|
context: context,
|
||||||
|
title: presentationData.strings.Gift_Buy_ErrorTooEarly_Title,
|
||||||
|
text: presentationData.strings.Gift_Buy_ErrorTooEarly_Text(dateString).string,
|
||||||
|
actions: [
|
||||||
|
TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})
|
||||||
|
],
|
||||||
|
parseMarkdown: true
|
||||||
|
)
|
||||||
|
controller.present(alertController, in: .window(.root))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let giftTitle = "\(uniqueGift.title) #\(uniqueGift.number)"
|
||||||
let recipientPeerId = self.recipientPeerId ?? self.context.account.peerId
|
let recipientPeerId = self.recipientPeerId ?? self.context.account.peerId
|
||||||
|
|
||||||
let action = {
|
let action = {
|
||||||
@ -1344,6 +1371,12 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||||||
} else {
|
} else {
|
||||||
proceed()
|
proceed()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
guard let controller = self.getController() else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let alertController = textAlertController(context: context, title: nil, text: presentationData.strings.Gift_Buy_ErrorUnknown, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})], parseMarkdown: true)
|
||||||
|
controller.present(alertController, in: .window(.root))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ final class ChatbotSearchResultItemComponent: Component {
|
|||||||
animateScale: false
|
animateScale: false
|
||||||
)),
|
)),
|
||||||
environment: {},
|
environment: {},
|
||||||
containerSize: CGSize(width: 100.0, height: 100.0)
|
containerSize: CGSize(width: 140.0, height: 100.0)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
if let addButton = self.addButton {
|
if let addButton = self.addButton {
|
||||||
|
@ -2401,7 +2401,6 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
|||||||
|
|
||||||
private func reportFailedIncomingCallKitCall() {
|
private func reportFailedIncomingCallKitCall() {
|
||||||
if #available(iOS 14.4, *) {
|
if #available(iOS 14.4, *) {
|
||||||
} else {
|
|
||||||
guard let callKitIntegration = CallKitIntegration.shared else {
|
guard let callKitIntegration = CallKitIntegration.shared else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1273,27 +1273,8 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
recognizer.waitForTouchUp = { [weak self] in
|
recognizer.waitForTouchUp = {
|
||||||
guard let strongSelf = self, let textInputNode = strongSelf.textInputNode else {
|
return true
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if textInputNode.textView.isFirstResponder {
|
|
||||||
return true
|
|
||||||
} else if let (_, _, _, bottomInset, _, _, metrics, _, _) = strongSelf.validLayout {
|
|
||||||
let textFieldWaitsForTouchUp: Bool
|
|
||||||
if case .regular = metrics.widthClass, bottomInset.isZero {
|
|
||||||
textFieldWaitsForTouchUp = true
|
|
||||||
} else if !textInputNode.textView.text.isEmpty {
|
|
||||||
textFieldWaitsForTouchUp = true
|
|
||||||
} else {
|
|
||||||
textFieldWaitsForTouchUp = false
|
|
||||||
}
|
|
||||||
|
|
||||||
return textFieldWaitsForTouchUp
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
textInputNode.view.addGestureRecognizer(recognizer)
|
textInputNode.view.addGestureRecognizer(recognizer)
|
||||||
self.touchDownGestureRecognizer = recognizer
|
self.touchDownGestureRecognizer = recognizer
|
||||||
@ -4086,6 +4067,10 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.inputMenu.activate()
|
self.inputMenu.activate()
|
||||||
|
|
||||||
|
if let touchDownGestureRecognizer = self.touchDownGestureRecognizer {
|
||||||
|
self.textInputNode?.view.addGestureRecognizer(touchDownGestureRecognizer)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func editableTextNodeDidBeginEditing(_ editableTextNode: ASEditableTextNode) {
|
@objc func editableTextNodeDidBeginEditing(_ editableTextNode: ASEditableTextNode) {
|
||||||
@ -4120,6 +4105,10 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let touchDownGestureRecognizer = self.touchDownGestureRecognizer {
|
||||||
|
self.textInputNode?.view.removeGestureRecognizer(touchDownGestureRecognizer)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func editableTextNodeDidFinishEditing(_ editableTextNode: ASEditableTextNode) {
|
func editableTextNodeDidFinishEditing(_ editableTextNode: ASEditableTextNode) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"app": "11.11.1",
|
"app": "11.11.2",
|
||||||
"xcode": "16.2",
|
"xcode": "16.2",
|
||||||
"bazel": "7.3.1:981f82a470bad1349322b6f51c9c6ffa0aa291dab1014fac411543c12e661dff",
|
"bazel": "7.3.1:981f82a470bad1349322b6f51c9c6ffa0aa291dab1014fac411543c12e661dff",
|
||||||
"macos": "15"
|
"macos": "15"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user