Skip to content

Commit d6cb84e

Browse files
committed
Merge commit '8a46bdffce88e172d748b7c5d283a8129595591d' into beta
2 parents d8efc7c + 8a46bdf commit d6cb84e

File tree

11 files changed

+154
-87
lines changed

11 files changed

+154
-87
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15226,8 +15226,10 @@ Error: %8$@";
1522615226
"Gift.AuctionBid.AddMoreStars" = "Add at least %@ to increase your bid.";
1522715227
"Gift.AuctionBid.AddMoreStars.Stars_1" = "%@ Star";
1522815228
"Gift.AuctionBid.AddMoreStars.Stars_any" = "%@ Stars";
15229+
"Gift.AuctionBid.AddMoreStars.Set" = "Set";
1522915230
"Gift.AuctionBid.Top" = "TOP %@";
1523015231
"Gift.AuctionBid.Custom" = "Custom";
15232+
"Gift.AuctionBid.MinimumBidIncreased" = "The minimum bid increased to **%@**.";
1523115233

1523215234
"Gift.AuctionBid.CustomBid.Title" = "Place a Custom Bid";
1523315235
"Gift.AuctionBid.CustomBid.Text" = "If you fall below the top %@, your bid will roll over to the next drop.";

submodules/AccountContext/Sources/AccountContext.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,8 +1423,8 @@ public protocol SharedAccountContext: AnyObject {
14231423
func makeGiftViewScreen(context: AccountContext, gift: StarGift.UniqueGift, shareStory: ((StarGift.UniqueGift) -> Void)?, openChatTheme: (() -> Void)?, dismissed: (() -> Void)?) -> ViewController
14241424
func makeGiftWearPreviewScreen(context: AccountContext, gift: StarGift.UniqueGift) -> ViewController
14251425
func makeGiftAuctionInfoScreen(context: AccountContext, auctionContext: GiftAuctionContext, completion: (() -> Void)?) -> ViewController
1426-
func makeGiftAuctionBidScreen(context: AccountContext, toPeerId: EnginePeer.Id, text: String?, entities: [MessageTextEntity]?, hideName: Bool, auctionContext: GiftAuctionContext, acquiredGifts: [GiftAuctionAcquiredGift]?) -> ViewController
1427-
func makeGiftAuctionViewScreen(context: AccountContext, auctionContext: GiftAuctionContext, completion: @escaping ([GiftAuctionAcquiredGift]?) -> Void) -> ViewController
1426+
func makeGiftAuctionBidScreen(context: AccountContext, toPeerId: EnginePeer.Id, text: String?, entities: [MessageTextEntity]?, hideName: Bool, auctionContext: GiftAuctionContext, acquiredGifts: Signal<[GiftAuctionAcquiredGift], NoError>?) -> ViewController
1427+
func makeGiftAuctionViewScreen(context: AccountContext, auctionContext: GiftAuctionContext, completion: @escaping (Signal<[GiftAuctionAcquiredGift], NoError>) -> Void) -> ViewController
14281428
func makeGiftAuctionActiveBidsScreen(context: AccountContext) -> ViewController
14291429

14301430
func makeStorySharingScreen(context: AccountContext, subject: StorySharingSubject, parentController: ViewController) -> ViewController

submodules/AccountContext/Sources/Premium.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,7 @@ public struct AccountFreezeConfiguration {
347347
public protocol GiftOptionsScreenProtocol {
348348

349349
}
350+
351+
public protocol GiftSetupScreenProtocol {
352+
353+
}

submodules/SettingsUI/Sources/Privacy and Security/LoginEmailSetupController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ public func loginEmailSetupController(context: AccountContext, blocking: Bool, e
212212
}
213213

214214
dismissEmailControllerImpl = { [weak emailController] in
215+
dismiss()
215216
emailController?.dismiss()
216217
}
217218
return emailController

submodules/TelegramCore/Sources/TelegramEngine/Contacts/ImportContact.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func _internal_importContact(account: Account, firstName: String, lastName: Stri
3636
transaction.replaceContactPeerIds(peerIds)
3737
}
3838
if !noteText.isEmpty {
39-
transaction.updatePeerCachedData(peerIds: peerIds, update: { peerId, cachedData in
39+
transaction.updatePeerCachedData(peerIds: [peerId], update: { peerId, cachedData in
4040
(cachedData as? CachedUserData)?.withUpdatedNote(.init(text: noteText, entities: noteEntities))
4141
})
4242
}
@@ -99,7 +99,7 @@ func _internal_addContactInteractively(account: Account, peerId: PeerId, firstNa
9999
transaction.replaceContactPeerIds(peerIds)
100100
}
101101
if !noteText.isEmpty {
102-
transaction.updatePeerCachedData(peerIds: peerIds, update: { peerId, cachedData in
102+
transaction.updatePeerCachedData(peerIds: [peerId], update: { peerId, cachedData in
103103
(cachedData as? CachedUserData)?.withUpdatedNote(.init(text: noteText, entities: noteEntities))
104104
})
105105
}

submodules/TelegramCore/Sources/TelegramEngine/Payments/StarGiftsAuctions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ extension GiftAuctionContext.State.MyState {
272272
}
273273
}
274274

275-
public struct GiftAuctionAcquiredGift {
275+
public struct GiftAuctionAcquiredGift: Equatable {
276276
public var nameHidden: Bool
277277
public let peer: EnginePeer
278278
public let date: Int32

submodules/TelegramUI/Components/Gifts/GiftOptionsScreen/Sources/GiftOptionsScreen.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ final class GiftOptionsScreenComponent: Component {
353353
return
354354
}
355355

356-
if let perUserLimit = gift.perUserLimit, perUserLimit.remains == 0 {
356+
if let perUserLimit = gift.perUserLimit, perUserLimit.remains == 0 && (gift.availability?.resale ?? 0) == 0 {
357357
let text = environment.strings.Gift_Options_Gift_BuyLimitReached(perUserLimit.total)
358358
let presentationData = component.context.sharedContext.currentPresentationData.with { $0 }
359359
let controller = UndoOverlayController(presentationData: presentationData, content: .sticker(context: component.context, file: gift.file, loop: true, title: nil, text: text, undoText: nil, customAction: nil), action: { _ in return false })
@@ -447,7 +447,7 @@ final class GiftOptionsScreenComponent: Component {
447447
}
448448
}))
449449
} else {
450-
if let availability = gift.availability, availability.remains == 0 {
450+
if let availability = gift.availability, availability.remains == 0 || gift.perUserLimit?.remains == 0 || component.peerId.namespace == Namespaces.Peer.CloudChannel {
451451
if availability.resale > 0 {
452452
let storeController = component.context.sharedContext.makeGiftStoreController(
453453
context: component.context,
@@ -611,7 +611,7 @@ final class GiftOptionsScreenComponent: Component {
611611
text = environment.strings.Gift_Options_Gift_Auction
612612
ribbonColor = .orange
613613
outline = .orange
614-
} else if let perUserLimit = gift.perUserLimit {
614+
} else if let perUserLimit = gift.perUserLimit, component.peerId.namespace != Namespaces.Peer.CloudChannel {
615615
text = environment.strings.Gift_Options_Gift_Limited_Left(perUserLimit.remains)
616616
} else {
617617
text = environment.strings.Gift_Options_Gift_Limited
@@ -1831,7 +1831,7 @@ final class GiftOptionsScreenComponent: Component {
18311831
var filteredStarGifts = starGifts
18321832
if peerId.namespace == Namespaces.Peer.CloudChannel {
18331833
filteredStarGifts = filteredStarGifts?.filter { gift in
1834-
if case let .generic(gift) = gift, gift.availability != nil {
1834+
if case let .generic(gift) = gift, let availability = gift.availability, availability.resale == 0 {
18351835
return false
18361836
}
18371837
return true

0 commit comments

Comments
 (0)