Cherry-pick fixes

This commit is contained in:
Ilya Laktyushin 2023-09-10 15:41:25 +04:00
parent f5c4ef594b
commit e5d2537683
5 changed files with 17 additions and 12 deletions

View File

@ -9900,11 +9900,4 @@ Sorry for the inconvenience.";
"SessionReview.Text" = "We have terminated the login attempt from **%1$@**, **%2$@**"; "SessionReview.Text" = "We have terminated the login attempt from **%1$@**, **%2$@**";
"SessionReview.OkAction" = "Got it"; "SessionReview.OkAction" = "Got it";
"WebApp.DisclaimerTitle" = "Terms of Use"; "WebApp.RemoveAllConfirmationText" = "This will remove **%@** shortcuts from all menus.";
"WebApp.DisclaimerText" = "You are about to use a mini app operated by an independent party not affiliated with Telegram. You must agree to the Terms of Use of mini apps to continue.";
"WebApp.DisclaimerAgree" = "I agree to the [Terms of Use]()";
"WebApp.DisclaimerContinue" = "Continue";
"WebApp.Disclaimer_URL" = "https://telegram.org/tos/mini-apps";
"WebApp.ShortcutsAdded" = "**%@** shortcut added in attachment menu.";
"WebApp.ShortcutsSettingsAdded" = "**%@** shortcut added in attachment menu and Settings.";

View File

@ -1690,6 +1690,12 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
self.hideStatusNodeUntilCentrality = false self.hideStatusNodeUntilCentrality = false
self.statusButtonNode.isHidden = self.hideStatusNodeUntilCentrality || self.statusNodeShouldBeHidden self.statusButtonNode.isHidden = self.hideStatusNodeUntilCentrality || self.statusNodeShouldBeHidden
videoNode.playOnceWithSound(playAndRecord: false, seek: seek, actionAtEnd: self.actionAtEnd) videoNode.playOnceWithSound(playAndRecord: false, seek: seek, actionAtEnd: self.actionAtEnd)
Queue.mainQueue().after(1.0, {
if let item = self.item, item.isSecret, !self.isPlaying {
videoNode.playOnceWithSound(playAndRecord: false, seek: .start, actionAtEnd: self.actionAtEnd)
}
})
} }
} }
} }

View File

@ -825,9 +825,13 @@ public final class TextFieldComponent: Component {
var rightmostX = lineRect.maxX + padding var rightmostX = lineRect.maxX + padding
let rightmostY = lineRect.minY + self.textView.textContainerInset.top let rightmostY = lineRect.minY + self.textView.textContainerInset.top
let stringIndex = self.textView.text.index(self.textView.text.startIndex, offsetBy: lineRange.location + lineRange.length - 1) let nsString = (self.textView.text as NSString)
if self.textView.text[stringIndex] == " " { let firstLineEndRange = NSMakeRange(lineRange.location + lineRange.length - 1, 1)
rightmostX -= 3.0 if nsString.length > firstLineEndRange.location + firstLineEndRange.length {
let lastChar = nsString.substring(with: firstLineEndRange)
if lastChar == " " {
rightmostX -= 2.0
}
} }
return CGPoint(x: rightmostX, y: rightmostY) return CGPoint(x: rightmostX, y: rightmostY)

View File

@ -19246,6 +19246,8 @@ func canAddMessageReactions(message: Message) -> Bool {
if story.isMention { if story.isMention {
return false return false
} }
} else if let _ = media as? TelegramMediaExpiredContent {
return false
} }
} }
return true return true

View File

@ -1530,7 +1530,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
if let strongSelf = self { if let strongSelf = self {
let presentationData = context.sharedContext.currentPresentationData.with { $0 } let presentationData = context.sharedContext.currentPresentationData.with { $0 }
strongSelf.present(textAlertController(context: context, title: presentationData.strings.WebApp_RemoveConfirmationTitle, text: presentationData.strings.WebApp_RemoveConfirmationText(strongSelf.botName).string, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { [weak self] in strongSelf.present(textAlertController(context: context, title: presentationData.strings.WebApp_RemoveConfirmationTitle, text: presentationData.strings.WebApp_RemoveAllConfirmationText(strongSelf.botName).string, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { [weak self] in
if let strongSelf = self { if let strongSelf = self {
let _ = context.engine.messages.removeBotFromAttachMenu(botId: strongSelf.botId).start() let _ = context.engine.messages.removeBotFromAttachMenu(botId: strongSelf.botId).start()
strongSelf.dismiss() strongSelf.dismiss()