Merge commit '7ff3593c69b1576f5ea3eaab38d4cf240181bdac'

This commit is contained in:
Peter 2019-09-28 01:36:51 +04:00
commit c506a69a9b
3 changed files with 6 additions and 8 deletions

View File

@ -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>

View File

@ -28,6 +28,7 @@ static_library(
"//submodules/TelegramStringFormatting:TelegramStringFormatting",
"//submodules/GlassButtonNode:GlassButtonNode",
"//submodules/UrlHandling:UrlHandling",
"//submodules/UrlEscaping:UrlEscaping",
"//submodules/LocalAuth:LocalAuth",
],
frameworks = [

View File

@ -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)"
}