Skip to content

Commit 4c085af

Browse files
committed
Merge commit '7facd8aaf0d1f7a7f80c4797f59467f6cb668918' into beta
2 parents f97eca0 + 7facd8a commit 4c085af

File tree

10 files changed

+94
-123
lines changed

10 files changed

+94
-123
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15570,7 +15570,7 @@ Error: %8$@";
1557015570
"Gift.Variants.CollectionInfo.Symbol_1" = "**%@** unique symbol";
1557115571
"Gift.Variants.CollectionInfo.Symbol_any" = "**%@** unique symbols";
1557215572

15573-
"Gift.Auction.GiftAuction" = "Upcoming Auction";
15573+
"Gift.Auction.GiftAuction" = "Gift Auction";
1557415574
"Gift.Auction.UpcomingAuction" = "Upcoming Auction";
1557515575
"Gift.Auction.LearnMore" = "Learn more about Telegram Gifts >";
1557615576

@@ -15614,7 +15614,7 @@ Error: %8$@";
1561415614
"Notification.StarGiftOffer.Expiration.Hours_any" = "%@ h";
1561515615
"Notification.StarGiftOffer.Expiration.Minutes_1" = "%@ m";
1561615616
"Notification.StarGiftOffer.Expiration.Minutes_any" = "%@ m";
15617-
"Notification.StarGiftOffer.Expiration.Delimiter" = "";
15617+
"Notification.StarGiftOffer.Expiration.Delimiter" = " ";
1561815618

1561915619
"Chat.GiftPurchaseOffer.AcceptConfirmation.Title" = "Confirm Sale";
1562015620
"Chat.GiftPurchaseOffer.AcceptConfirmation.Text" = "Do you want to sell **%1$@** to %2$@ for **%3$@**? You'll receive **%4$@** after fees.";

submodules/LegacyComponents/Sources/TGViewController.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,11 @@ + (UIEdgeInsets)safeAreaInsetForOrientation:(UIInterfaceOrientation)orientation
11351135
return UIEdgeInsetsMake(0.0f, 44.0f, 21.0f, 44.0f);
11361136

11371137
default:
1138-
return UIEdgeInsetsMake(44.0f, 0.0f, 34.0f, 0.0f);
1138+
if (iosMajorVersion() >= 26) {
1139+
return UIEdgeInsetsMake(44.0f, 0.0f, 20.0f, 0.0f);
1140+
} else {
1141+
return UIEdgeInsetsMake(44.0f, 0.0f, 34.0f, 0.0f);
1142+
}
11391143
}
11401144
}
11411145

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

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,32 +3822,34 @@ final class CachedStartGiftUpgradeAttributes: Codable {
38223822

38233823
func _internal_getStarGiftUpgradeAttributes(account: Account, giftId: Int64) -> Signal<[StarGift.UniqueGift.Attribute]?, NoError> {
38243824
return account.postbox.transaction { transaction in
3825-
if let cachedGifts = transaction.retrieveItemCacheEntry(id: giftUpgradesId(giftId: giftId))?.get(CachedStartGiftUpgradeAttributes.self) {
3826-
return .single(cachedGifts.attributes)
3827-
} else {
3828-
return account.network.request(Api.functions.payments.getStarGiftUpgradeAttributes(giftId: giftId))
3829-
|> map(Optional.init)
3830-
|> `catch` { _ -> Signal<Api.payments.StarGiftUpgradeAttributes?, NoError> in
3825+
let remote = account.network.request(Api.functions.payments.getStarGiftUpgradeAttributes(giftId: giftId))
3826+
|> map(Optional.init)
3827+
|> `catch` { _ -> Signal<Api.payments.StarGiftUpgradeAttributes?, NoError> in
3828+
return .single(nil)
3829+
}
3830+
|> mapToSignal { result -> Signal<[StarGift.UniqueGift.Attribute]?, NoError> in
3831+
guard let result else {
38313832
return .single(nil)
38323833
}
3833-
|> mapToSignal { result -> Signal<[StarGift.UniqueGift.Attribute]?, NoError> in
3834-
guard let result else {
3835-
return .single(nil)
3836-
}
3837-
switch result {
3838-
case let .starGiftUpgradeAttributes(apiAttributes):
3839-
let attributes = apiAttributes.compactMap { StarGift.UniqueGift.Attribute(apiAttribute: $0) }
3840-
return account.postbox.transaction { transaction in
3841-
if !attributes.isEmpty {
3842-
if let entry = CodableEntry(CachedStartGiftUpgradeAttributes(attributes: attributes)) {
3843-
transaction.putItemCacheEntry(id: giftUpgradesId(giftId: giftId), entry: entry)
3844-
}
3834+
switch result {
3835+
case let .starGiftUpgradeAttributes(apiAttributes):
3836+
let attributes = apiAttributes.compactMap { StarGift.UniqueGift.Attribute(apiAttribute: $0) }
3837+
return account.postbox.transaction { transaction in
3838+
if !attributes.isEmpty {
3839+
if let entry = CodableEntry(CachedStartGiftUpgradeAttributes(attributes: attributes)) {
3840+
transaction.putItemCacheEntry(id: giftUpgradesId(giftId: giftId), entry: entry)
38453841
}
3846-
return attributes
38473842
}
3843+
return attributes
38483844
}
38493845
}
38503846
}
3847+
if let cachedGifts = transaction.retrieveItemCacheEntry(id: giftUpgradesId(giftId: giftId))?.get(CachedStartGiftUpgradeAttributes.self) {
3848+
return .single(cachedGifts.attributes)
3849+
|> then(remote)
3850+
} else {
3851+
return remote
3852+
}
38513853
}
38523854
|> switchToLatest
38533855
}

submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ public func makeDefaultDarkPresentationTheme(extendingThemeReference: Presentati
348348
badgeBackgroundColor: UIColor(rgb: 0xffffff),
349349
badgeStrokeColor: UIColor(rgb: 0x1c1c1d),
350350
badgeTextColor: UIColor(rgb: 0x000000),
351-
segmentedBackgroundColor: UIColor(rgb: 0x3a3b3d),
352-
segmentedForegroundColor: UIColor(rgb: 0x6f7075),
351+
segmentedBackgroundColor: UIColor(rgb: 0xffffff, alpha: 0.11),
352+
segmentedForegroundColor: UIColor(rgb: 0xffffff, alpha: 0.36),
353353
segmentedTextColor: UIColor(rgb: 0xffffff),
354354
segmentedDividerColor: UIColor(rgb: 0x505155),
355355
clearButtonBackgroundColor: UIColor(rgb: 0xffffff, alpha: 0.1),

submodules/TelegramPresentationData/Sources/DefaultDarkTintedPresentationTheme.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public func customizeDefaultDarkTintedPresentationTheme(theme: PresentationTheme
139139
opaqueBackgroundColor: mainBackgroundColor,
140140
separatorColor: mainSeparatorColor,
141141
segmentedBackgroundColor: mainInputColor,
142-
segmentedForegroundColor: mainBackgroundColor,
142+
segmentedForegroundColor: mainSecondaryTextColor?.withAlphaComponent(0.4),
143143
segmentedDividerColor: mainSecondaryTextColor?.withAlphaComponent(0.5)
144144
),
145145
navigationSearchBar: rootController.navigationSearchBar.withUpdated(
@@ -571,7 +571,7 @@ public func makeDefaultDarkTintedPresentationTheme(extendingThemeReference: Pres
571571
badgeStrokeColor: UIColor(rgb: 0xef5b5b),
572572
badgeTextColor: UIColor(rgb: 0xffffff),
573573
segmentedBackgroundColor: mainInputColor,
574-
segmentedForegroundColor: mainBackgroundColor,
574+
segmentedForegroundColor: mainSecondaryTextColor.withAlphaComponent(0.4),
575575
segmentedTextColor: UIColor(rgb: 0xffffff),
576576
segmentedDividerColor: mainSecondaryTextColor.withAlphaComponent(0.5),
577577
clearButtonBackgroundColor: UIColor(rgb: 0xffffff, alpha: 0.1),

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,14 +514,16 @@ public class ChatMessageForwardInfoNode: ASDisplayNode {
514514
}
515515
titleNode.frame = CGRect(origin: CGPoint(x: leftOffset, y: 0.0), size: titleLayout.size)
516516

517+
var nameFrame = CGRect()
517518
if let (nameLayout, nameApply) = nameLayoutAndApply {
518519
let nameNode = nameApply()
519520
if node.nameNode == nil {
520521
nameNode.isUserInteractionEnabled = false
521522
node.nameNode = nameNode
522523
node.addSubnode(nameNode)
523524
}
524-
nameNode.frame = CGRect(origin: CGPoint(x: leftOffset + authorAvatarInset, y: titleLayout.size.height + titleAuthorSpacing), size: nameLayout.size)
525+
nameFrame = CGRect(origin: CGPoint(x: leftOffset + authorAvatarInset, y: titleLayout.size.height + titleAuthorSpacing), size: nameLayout.size)
526+
nameNode.frame = nameFrame
525527

526528
if authorAvatarInset != 0.0 {
527529
let avatarNode: AvatarNode
@@ -599,7 +601,7 @@ public class ChatMessageForwardInfoNode: ASDisplayNode {
599601
node.credibilityIconNode = credibilityIconNode
600602
node.addSubnode(credibilityIconNode)
601603
}
602-
credibilityIconNode.frame = CGRect(origin: CGPoint(x: titleLayout.size.width + 4.0, y: 16.0), size: credibilityIconImage.size)
604+
credibilityIconNode.frame = CGRect(origin: CGPoint(x: nameFrame.maxX + 4.0, y: 17.0), size: credibilityIconImage.size)
603605
credibilityIconNode.image = credibilityIconImage
604606
} else {
605607
node.credibilityIconNode?.removeFromSupernode()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private final class DemoSheetContent: CombinedComponent {
293293
let bottomEdgeEffectHeight = 108.0
294294
let bottomEdgeEffect = bottomEdgeEffect.update(
295295
component: EdgeEffectComponent(
296-
color: .clear,
296+
color: environment.theme.actionSheet.opaqueItemBackgroundColor,
297297
blur: true,
298298
alpha: 1.0,
299299
size: CGSize(width: context.availableSize.width, height: bottomEdgeEffectHeight),

submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftUpgradePreviewScreen.swift

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -409,26 +409,26 @@ private final class GiftUpgradePreviewScreenComponent: Component {
409409
var isSelected = false
410410
for attribute in attributeList {
411411
switch attribute {
412-
case let .model(name, _, rarityValue):
413-
itemId += name
412+
case let .model(name, file, rarityValue):
413+
itemId += "\(file.fileId.id)"
414414
if self.selectedSection == .models {
415415
title = name
416416
rarity = rarityValue
417417
modelAttribute = attribute
418418

419419
isSelected = self.selectedModel == attribute
420420
}
421-
case let .backdrop(name, _, _, _, _, _, rarityValue):
422-
itemId += name
421+
case let .backdrop(name, id, _, _, _, _, rarityValue):
422+
itemId += "\(id)"
423423
if self.selectedSection == .backdrops {
424424
title = name
425425
rarity = rarityValue
426426
backdropAttribute = attribute
427427

428428
isSelected = self.selectedBackdrop == attribute
429429
}
430-
case let .pattern(name, _, rarityValue):
431-
itemId += name
430+
case let .pattern(name, file, rarityValue):
431+
itemId += "\(file.fileId.id)"
432432
if self.selectedSection == .symbols {
433433
title = name
434434
rarity = rarityValue
@@ -732,15 +732,23 @@ private final class GiftUpgradePreviewScreenComponent: Component {
732732
transition.setFrame(view: titleView, frame: titleFrame)
733733
}
734734

735+
var subtitleItems: [AnimatedTextComponent.Item] = []
736+
let subtitleString = self.isPlaying ? environment.strings.Gift_Variants_RandomTraits : environment.strings.Gift_Variants_SelectedTraits
737+
let words = subtitleString.components(separatedBy: " ")
738+
for i in 0 ..< words.count {
739+
var text = words[i]
740+
if i > 0 {
741+
text = " \(text)"
742+
}
743+
subtitleItems.append(AnimatedTextComponent.Item(id: text.lowercased(), content: .text(text)))
744+
}
745+
735746
let subtitleSize = self.subtitle.update(
736747
transition: .spring(duration: 0.2),
737748
component: AnyComponent(AnimatedTextComponent(
738749
font: Font.regular(14.0),
739750
color: secondaryTextColor,
740-
items: [
741-
AnimatedTextComponent.Item(id: self.isPlaying ? "random" : "selected", content: .text(self.isPlaying ? "Random" : "Selected")),
742-
AnimatedTextComponent.Item(id: "traits", content: .text(" Traits"))
743-
],
751+
items: subtitleItems,
744752
noDelay: true,
745753
blur: true
746754
)),

submodules/TelegramUI/Components/SegmentControlComponent/Sources/SegmentControlComponent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public final class SegmentControlComponent: Component {
127127
}
128128

129129
if themeUpdated {
130-
let backgroundColor = component.theme.overallDarkAppearance ? component.theme.list.itemBlocksBackgroundColor : component.theme.rootController.navigationBar.segmentedBackgroundColor
130+
let backgroundColor = component.theme.rootController.navigationBar.segmentedBackgroundColor
131131
segmentedView.setTitleTextAttributes([
132132
.font: Font.semibold(14.0),
133133
.foregroundColor: component.theme.rootController.navigationBar.segmentedTextColor

0 commit comments

Comments
 (0)