mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various improvements
This commit is contained in:
parent
60196075a6
commit
d21d943d8d
@ -209,7 +209,7 @@ public final class DrawingLinkEntityView: DrawingEntityView, UITextViewDelegate
|
|||||||
if !self.linkEntity.name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
if !self.linkEntity.name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||||
string = self.linkEntity.name.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
|
string = self.linkEntity.name.trimmingCharacters(in: .whitespacesAndNewlines).uppercased()
|
||||||
} else {
|
} else {
|
||||||
string = self.linkEntity.url.uppercased()
|
string = self.linkEntity.url.uppercased().replacingOccurrences(of: "http://", with: "").replacingOccurrences(of: "https://", with: "")
|
||||||
}
|
}
|
||||||
let text = NSMutableAttributedString(string: string)
|
let text = NSMutableAttributedString(string: string)
|
||||||
let range = NSMakeRange(0, text.length)
|
let range = NSMakeRange(0, text.length)
|
||||||
|
@ -1104,7 +1104,7 @@ private final class TwoFactorDataInputTextNode: ASDisplayNode, UITextFieldDelega
|
|||||||
self.hideButtonNode.isHidden = confirmation
|
self.hideButtonNode.isHidden = confirmation
|
||||||
case .email:
|
case .email:
|
||||||
self.inputNode.textField.keyboardType = .emailAddress
|
self.inputNode.textField.keyboardType = .emailAddress
|
||||||
self.inputNode.textField.returnKeyType = .done
|
self.inputNode.textField.returnKeyType = .next
|
||||||
self.hideButtonNode.isHidden = true
|
self.hideButtonNode.isHidden = true
|
||||||
|
|
||||||
if #available(iOS 12.0, *) {
|
if #available(iOS 12.0, *) {
|
||||||
@ -1134,7 +1134,7 @@ private final class TwoFactorDataInputTextNode: ASDisplayNode, UITextFieldDelega
|
|||||||
}
|
}
|
||||||
case .hint:
|
case .hint:
|
||||||
self.inputNode.textField.keyboardType = .asciiCapable
|
self.inputNode.textField.keyboardType = .asciiCapable
|
||||||
self.inputNode.textField.returnKeyType = .done
|
self.inputNode.textField.returnKeyType = .next
|
||||||
self.hideButtonNode.isHidden = true
|
self.hideButtonNode.isHidden = true
|
||||||
|
|
||||||
self.inputNode.textField.autocorrectionType = .no
|
self.inputNode.textField.autocorrectionType = .no
|
||||||
|
@ -466,14 +466,21 @@ private final class CreateLinkSheetComponent: CombinedComponent {
|
|||||||
let text = !self.name.isEmpty ? self.name : self.link
|
let text = !self.name.isEmpty ? self.name : self.link
|
||||||
|
|
||||||
var effectiveMedia: TelegramMediaWebpage?
|
var effectiveMedia: TelegramMediaWebpage?
|
||||||
if let webpage = self.webpage, case .Loaded = webpage.content, !self.dismissed {
|
var webpageHasLargeMedia = false
|
||||||
|
if let webpage = self.webpage, case let .Loaded(content) = webpage.content, !self.dismissed {
|
||||||
effectiveMedia = webpage
|
effectiveMedia = webpage
|
||||||
|
|
||||||
|
if let isMediaLargeByDefault = content.isMediaLargeByDefault, isMediaLargeByDefault {
|
||||||
|
webpageHasLargeMedia = true
|
||||||
|
} else {
|
||||||
|
webpageHasLargeMedia = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var attributes: [MessageAttribute] = []
|
var attributes: [MessageAttribute] = []
|
||||||
attributes.append(TextEntitiesMessageAttribute(entities: [.init(range: 0 ..< (text as NSString).length, type: .Url)]))
|
attributes.append(TextEntitiesMessageAttribute(entities: [.init(range: 0 ..< (text as NSString).length, type: .Url)]))
|
||||||
if !self.dismissed {
|
if !self.dismissed {
|
||||||
attributes.append(WebpagePreviewMessageAttribute(leadingPreview: !self.positionBelowText, forceLargeMedia: self.largeMedia, isManuallyAdded: false, isSafe: true))
|
attributes.append(WebpagePreviewMessageAttribute(leadingPreview: !self.positionBelowText, forceLargeMedia: self.largeMedia ?? webpageHasLargeMedia, isManuallyAdded: false, isSafe: true))
|
||||||
}
|
}
|
||||||
|
|
||||||
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(1))
|
let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(1))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user