Skip to content

Commit 5e17b32

Browse files
committed
Various improvements
1 parent 74e1d22 commit 5e17b32

File tree

19 files changed

+743
-343
lines changed

19 files changed

+743
-343
lines changed

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

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15167,7 +15167,12 @@ Error: %8$@";
1516715167
"ScheduledMessages.Reminder.Delete" = "Delete Reminder";
1516815168
"ScheduledMessages.Reminder.DeleteMany" = "Delete Reminders";
1516915169

15170-
"Gift.Setup.NextDropIn" = "next drop in {m}:{s}";
15170+
"Gift.Setup.PlaceBid" = "Place a Bid";
15171+
"Gift.Setup.AuctionInfo" = "%@ are dropped to the top %@ by bid amount. [Learn more >]()";
15172+
"Gift.Setup.AuctionInfo.Gifts_1" = "%@ gift";
15173+
"Gift.Setup.AuctionInfo.Gifts_any" = "%@ gifts";
15174+
"Gift.Setup.AuctionInfo.Bidders_1" = "%@ bidder";
15175+
"Gift.Setup.AuctionInfo.Bidders_any" = "%@ bidders";
1517115176

1517215177
"PrivacySettings.LoginEmailSetupInfo" = "Setup your email address for Telegram login codes.";
1517315178

@@ -15223,6 +15228,11 @@ Error: %8$@";
1522315228
"Gift.AuctionBid.Top" = "TOP %@";
1522415229
"Gift.AuctionBid.Custom" = "Custom";
1522515230

15231+
"Gift.AuctionBid.CustomBid.Title" = "Place a Custom Bid";
15232+
"Gift.AuctionBid.CustomBid.Text" = "If you fall below the top %@, your bid will roll over to the next drop.";
15233+
"Gift.AuctionBid.CustomBid.Placeholder" = "Amount";
15234+
"Gift.AuctionBid.CustomBid.Done" = "Place a Bid";
15235+
1522615236
"Gift.Auction.Context.About" = "About";
1522715237
"Gift.Auction.Context.CopyLink" = "Copy Link";
1522815238
"Gift.Auction.Context.Share" = "Share";
@@ -15269,11 +15279,6 @@ Error: %8$@";
1526915279
"ChatList.Auctions.Status.Many.OutbidAll" = "You've been outbid in all of them.";
1527015280
"ChatList.Auctions.View" = "View";
1527115281

15272-
"Gift.Auction.Ongoing.Title" = "One Auction at a Time";
15273-
"Gift.Auction.Ongoing.Text" = "You’ve already bid in this gift auction for **%@**.";
15274-
"Gift.Auction.Ongoing.TextYourself" = "You’ve already bid in this gift auction for yourself.";
15275-
"Gift.Auction.Ongoing.View" = "View";
15276-
1527715282
"Gift.Auction.Info.Title" = "Auction";
1527815283
"Gift.Auction.Info.Description" = "Join the battle for exclusive gifts.";
1527915284

@@ -15368,7 +15373,14 @@ Error: %8$@";
1536815373
"Stars.Transaction.LiveStreamPaidMessage_any" = "Fee for %@ Live Stream Messages";
1536915374
"Stars.Transaction.LiveStreamPaidMessage.Text" = "You receive **%@%** of the price that you charge for each incoming message.";
1537015375

15371-
"Notification.StarGift.Subtitle.NoConvert" = "We'll notify you once it becomes eligible for unique upgrades.";
15372-
"Notification.StarGift.Subtitle.OtherNoConvert" = "We'll notify %1$@ once it becomes eligible for unique upgrades.";
15373-
"Gift.View.NoConvertDescription" = "We'll notify you once it becomes eligible for unique upgrades.";
15374-
"Gift.View.OtherNoConvertDescription" = "We'll notify %1$@ once it becomes eligible for unique upgrades.";
15376+
"Notification.StarGift.Subtitle.NoConvert" = "Display this gift on your page and turn it into a collectible.";
15377+
"Notification.StarGift.Subtitle.OtherNoConvert" = "Display this gift on your page and turn it into a collectible.";
15378+
"Gift.View.NoConvertDescription" = "We will notify you once it becomes eligible for unique upgrades.";
15379+
"Gift.View.OtherNoConvertDescription" = "We will notify %1$@ once it becomes eligible for unique upgrades.";
15380+
15381+
"Gift.AuctionTransfer.Title" = "Change Recipient";
15382+
"Gift.AuctionTransfer.Text" = "The current recipient of this gift is **%@**. Change to **%@**?";
15383+
"Gift.AuctionTransfer.TextFromYourself" = "The current recipient of this gift is you. Change to **%@**?";
15384+
"Gift.AuctionTransfer.TextToYourself" = "The current recipient of this gift is **%@**. Change to yourself?";
15385+
"Gift.AuctionTransfer.Change" = "Change";
15386+

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, auctionContext: GiftAuctionContext) -> ViewController
1427-
func makeGiftAuctionViewScreen(context: AccountContext, toPeerId: EnginePeer.Id, auctionContext: GiftAuctionContext) -> ViewController
1426+
func makeGiftAuctionBidScreen(context: AccountContext, toPeerId: EnginePeer.Id, text: String?, entities: [MessageTextEntity]?, hideName: Bool, auctionContext: GiftAuctionContext) -> ViewController
1427+
func makeGiftAuctionViewScreen(context: AccountContext, auctionContext: GiftAuctionContext, completion: @escaping () -> Void) -> ViewController
14281428
func makeGiftAuctionActiveBidsScreen(context: AccountContext) -> ViewController
14291429

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

submodules/TelegramBaseController/Sources/TelegramBaseController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ open class TelegramBaseController: ViewController, KeyShortcutResponder {
565565
guard let self, let auction else {
566566
return
567567
}
568-
let controller = self.context.sharedContext.makeGiftAuctionBidScreen(context: self.context, toPeerId: auction.currentBidPeerId ?? self.context.account.peerId, auctionContext: auction)
568+
let controller = self.context.sharedContext.makeGiftAuctionBidScreen(context: self.context, toPeerId: auction.currentBidPeerId ?? self.context.account.peerId, text: nil, entities: nil, hideName: false, auctionContext: auction)
569569
self.push(controller)
570570
})
571571
}

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

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public enum BotPaymentInvoiceSource {
2020
case starGiftResale(slug: String, toPeerId: EnginePeer.Id, ton: Bool)
2121
case starGiftPrepaidUpgrade(peerId: EnginePeer.Id, hash: String)
2222
case starGiftDropOriginalDetails(reference: StarGiftReference)
23-
case starGiftAuctionBid(update: Bool, hideName: Bool, peerId: EnginePeer.Id, giftId: Int64, bidAmount: Int64, text: String?, entities: [MessageTextEntity]?)
23+
case starGiftAuctionBid(update: Bool, hideName: Bool, peerId: EnginePeer.Id?, giftId: Int64, bidAmount: Int64, text: String?, entities: [MessageTextEntity]?)
2424
}
2525

2626
public struct BotPaymentInvoiceFields: OptionSet {
@@ -426,22 +426,27 @@ func _internal_parseInputInvoice(transaction: Transaction, source: BotPaymentInv
426426
return reference.apiStarGiftReference(transaction: transaction).flatMap { .inputInvoiceStarGiftDropOriginalDetails(stargift: $0) }
427427

428428
case let .starGiftAuctionBid(update, hideName, peerId, giftId, bidAmount, text, entities):
429-
guard let peer = transaction.getPeer(peerId), let inputPeer = apiInputPeer(peer) else {
430-
return nil
431-
}
432429
var flags: Int32 = 0
433-
if hideName {
434-
flags |= (1 << 0)
435-
}
430+
var inputPeer: Api.InputPeer?
431+
var message: Api.TextWithEntities?
436432
if update {
437433
flags |= (1 << 2)
438434
}
439-
flags |= (1 << 3)
440-
441-
var message: Api.TextWithEntities?
442-
if let text, !text.isEmpty {
443-
flags |= (1 << 1)
444-
message = .textWithEntities(text: text, entities: entities.flatMap { apiEntitiesFromMessageTextEntities($0, associatedPeers: SimpleDictionary()) } ?? [])
435+
if let peerId {
436+
guard let peer = transaction.getPeer(peerId).flatMap(apiInputPeer) else {
437+
return nil
438+
}
439+
flags |= (1 << 3)
440+
inputPeer = peer
441+
442+
if hideName {
443+
flags |= (1 << 0)
444+
}
445+
446+
if let text, !text.isEmpty {
447+
flags |= (1 << 1)
448+
message = .textWithEntities(text: text, entities: entities.flatMap { apiEntitiesFromMessageTextEntities($0, associatedPeers: SimpleDictionary()) } ?? [])
449+
}
445450
}
446451
return .inputInvoiceStarGiftAuctionBid(flags: flags, peer: inputPeer, giftId: giftId, bidAmount: bidAmount, message: message)
447452
}

submodules/TelegramUI/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ swift_library(
464464
"//submodules/TelegramUI/Components/Stars/StarsIntroScreen",
465465
"//submodules/TelegramUI/Components/Gifts/GiftOptionsScreen",
466466
"//submodules/TelegramUI/Components/Gifts/GiftStoreScreen",
467+
"//submodules/TelegramUI/Components/Gifts/GiftSetupScreen",
467468
"//submodules/TelegramUI/Components/ContentReportScreen",
468469
"//submodules/TelegramUI/Components/PeerInfo/AffiliateProgramSetupScreen",
469470
"//submodules/TelegramUI/Components/Stars/StarsBalanceOverlayComponent",

submodules/TelegramUI/Components/CameraScreen/Sources/CameraScreen.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,13 +1946,13 @@ private final class CameraScreenComponent: CombinedComponent {
19461946
view.animateIn()
19471947
}
19481948
}))
1949-
.disappear(ComponentTransition.Disappear({ view, transition, completion in
1950-
if let view = view as? CollageIconCarouselComponent.View, !transition.animation.isImmediate {
1951-
view.animateOut(completion: completion)
1952-
} else {
1953-
completion()
1954-
}
1955-
}))
1949+
.disappear(ComponentTransition.Disappear({ view, transition, completion in
1950+
if let view = view as? CollageIconCarouselComponent.View, !transition.animation.isImmediate {
1951+
view.animateOut(completion: completion)
1952+
} else {
1953+
completion()
1954+
}
1955+
}))
19561956
)
19571957
}
19581958
}

submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,11 @@ public class ChatMessageGiftBubbleContentNode: ChatMessageBubbleContentNode {
556556
}
557557
case let .starGift(gift, convertStars, giftText, giftEntities, _, savedToProfile, converted, upgraded, canUpgrade, upgradeStars, isRefunded, isPrepaidUpgrade, _, channelPeerId, senderPeerId, _, _, _, _, _, toPeerId):
558558
var incoming = incoming
559+
var convertStars = convertStars
559560
if case let .generic(gift) = gift {
561+
if gift.flags.contains(.isAuction) {
562+
convertStars = nil
563+
}
560564
if let releasedBy = gift.releasedBy, let peer = item.message.peers[releasedBy], let addressName = peer.addressName {
561565
creatorButtonTitle = item.presentationData.strings.Notification_StarGift_ReleasedBy("**@\(addressName)**").string
562566
}
@@ -656,7 +660,7 @@ public class ChatMessageGiftBubbleContentNode: ChatMessageBubbleContentNode {
656660
entities.append(MessageTextEntity(range: starsRange.range.lowerBound ..< starsRange.range.upperBound, type: .Bold))
657661
}
658662
} else {
659-
text = item.presentationData.strings.Notification_StarGift_Subtitle_OtherNoConvert(peerName).string
663+
text = item.presentationData.strings.Notification_StarGift_Subtitle_OtherNoConvert
660664
}
661665
}
662666
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public final class GiftItemComponent: Component {
441441
let _ = loadingBackground.update(
442442
transition: transition,
443443
component: AnyComponent(
444-
ItemShimmeringLoadingComponent(color: component.theme.list.itemAccentColor, cornerRadius: 10.0)
444+
ItemShimmeringLoadingComponent(color: component.theme.list.itemAccentColor, cornerRadius: cornerRadius)
445445
),
446446
environment: {},
447447
containerSize: size

0 commit comments

Comments
 (0)