mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
9a075f5fde
@ -431,6 +431,11 @@ private func availablePaymentMethods(form: BotPaymentForm, current: BotCheckoutP
|
||||
methods.append(current)
|
||||
}
|
||||
}
|
||||
if let savedCredentials = form.savedCredentials {
|
||||
if !methods.contains(.savedCredentials(savedCredentials)) {
|
||||
methods.append(.savedCredentials(savedCredentials))
|
||||
}
|
||||
}
|
||||
return methods
|
||||
}
|
||||
|
||||
|
||||
@ -353,10 +353,21 @@ final class BotCheckoutNativeCardEntryControllerNode: ViewControllerTracingNode,
|
||||
guard let maskedCardNumber = resultInfo["masked_card_number"] as? String else {
|
||||
throw ReponseError.generic
|
||||
}
|
||||
guard let cardType = resultInfo["card_type"] as? String else {
|
||||
throw ReponseError.generic
|
||||
}
|
||||
|
||||
var last4 = maskedCardNumber
|
||||
if last4.count > 4 {
|
||||
let lastDigits = String(maskedCardNumber[maskedCardNumber.index(maskedCardNumber.endIndex, offsetBy: -4)...])
|
||||
if lastDigits.allSatisfy(\.isNumber) {
|
||||
last4 = "\(cardType) *\(lastDigits)"
|
||||
}
|
||||
}
|
||||
|
||||
let responseJson: [String: Any] = [
|
||||
"type": "card",
|
||||
"id": "\(token)"
|
||||
"token": "\(token)"
|
||||
]
|
||||
|
||||
let serializedResponseJson = try JSONSerialization.data(withJSONObject: responseJson, options: [])
|
||||
@ -366,7 +377,7 @@ final class BotCheckoutNativeCardEntryControllerNode: ViewControllerTracingNode,
|
||||
}
|
||||
|
||||
strongSelf.completion(.webToken(BotCheckoutPaymentWebToken(
|
||||
title: maskedCardNumber,
|
||||
title: last4,
|
||||
data: serializedResponseString,
|
||||
saveOnServer: strongSelf.saveInfoItem.isOn
|
||||
)))
|
||||
|
||||
@ -823,6 +823,8 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
}
|
||||
|
||||
deinit {
|
||||
assert(Queue.mainQueue().isCurrent())
|
||||
|
||||
self.audioSessionShouldBeActiveDisposable?.dispose()
|
||||
self.audioSessionActiveDisposable?.dispose()
|
||||
self.summaryStateDisposable?.dispose()
|
||||
@ -1074,6 +1076,9 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
activeCallInfo = nil
|
||||
}
|
||||
}
|
||||
if self.leaving {
|
||||
shouldJoin = false
|
||||
}
|
||||
|
||||
if shouldJoin, let callInfo = activeCallInfo {
|
||||
let callContext: OngoingGroupCallContext
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user