mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-29 14:40:42 +00:00
Merge commit '7ff3593c69b1576f5ea3eaab38d4cf240181bdac'
This commit is contained in:
commit
c506a69a9b
@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.12</string>
|
||||
<string>$(PRODUCT_BUNDLE_SHORT_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${BUILD_NUMBER}</string>
|
||||
<key>NSExtension</key>
|
||||
|
@ -28,6 +28,7 @@ static_library(
|
||||
"//submodules/TelegramStringFormatting:TelegramStringFormatting",
|
||||
"//submodules/GlassButtonNode:GlassButtonNode",
|
||||
"//submodules/UrlHandling:UrlHandling",
|
||||
"//submodules/UrlEscaping:UrlEscaping",
|
||||
"//submodules/LocalAuth:LocalAuth",
|
||||
],
|
||||
frameworks = [
|
||||
|
@ -11,6 +11,7 @@ import ItemListUI
|
||||
import SwiftSignalKit
|
||||
import OverlayStatusController
|
||||
import ShareController
|
||||
import UrlEscaping
|
||||
|
||||
private final class WalletReceiveScreenArguments {
|
||||
let context: AccountContext
|
||||
@ -275,7 +276,7 @@ private func walletReceiveScreenEntries(presentationData: PresentationData, addr
|
||||
addressText = formatAddress(address)
|
||||
addressMonospace = true
|
||||
} else {
|
||||
addressText = invoiceUrl(address: address, state: state, escapeComment: false)
|
||||
addressText = invoiceUrl(address: address, state: state, escapeComment: true)
|
||||
}
|
||||
entries.append(.address(presentationData.theme, addressText, addressMonospace))
|
||||
entries.append(.copyAddress(presentationData.theme, state.isEmpty ? presentationData.strings.Wallet_Receive_CopyAddress : presentationData.strings.Wallet_Receive_CopyInvoiceUrl))
|
||||
@ -306,13 +307,9 @@ private func invoiceUrl(address: String, state: WalletReceiveScreenState, escape
|
||||
arguments += arguments.isEmpty ? "?" : "&"
|
||||
arguments += "amount=\(amountValue(state.amount))"
|
||||
}
|
||||
if !state.comment.isEmpty, let escapedComment = state.comment.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
|
||||
if !state.comment.isEmpty {
|
||||
arguments += arguments.isEmpty ? "?" : "&"
|
||||
if escapeComment {
|
||||
arguments += "text=\(escapedComment)"
|
||||
} else {
|
||||
arguments += "text=\(state.comment)"
|
||||
}
|
||||
arguments += "text=\(urlEncodedStringFromString(state.comment))"
|
||||
}
|
||||
return "ton://transfer/\(address)\(arguments)"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user