From 8f70aa39574803d1c68e25ddceed0b79ac9bd187 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 13 Aug 2025 10:27:26 +0400 Subject: [PATCH] Various fixes --- .../Sources/HashtagSearchNavigationContentNode.swift | 2 +- .../Sources/ItemListControllerTabsContentNode.swift | 2 +- .../Sources/TelegramEngine/Peers/SavedMusic.swift | 2 +- .../Sources/ChatMessageGiftBubbleContentNode.swift | 2 +- .../Gifts/GiftViewScreen/Sources/GiftViewScreen.swift | 6 ++++-- .../TabSelectorComponent/Sources/TabSelectorComponent.swift | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/submodules/HashtagSearchUI/Sources/HashtagSearchNavigationContentNode.swift b/submodules/HashtagSearchUI/Sources/HashtagSearchNavigationContentNode.swift index baffc6678d..1a7d6f3e0a 100644 --- a/submodules/HashtagSearchUI/Sources/HashtagSearchNavigationContentNode.swift +++ b/submodules/HashtagSearchUI/Sources/HashtagSearchNavigationContentNode.swift @@ -172,7 +172,7 @@ final class HashtagSearchNavigationContentNode: NavigationBarContentNode { containerSize: CGSize(width: size.width, height: 44.0) ) let tabSelectorFrameOriginX = floorToScreenPixels((size.width - tabSelectorSize.width) / 2.0) - let tabSelectorFrame = CGRect(origin: CGPoint(x: tabSelectorFrameOriginX, y: size.height - tabSelectorSize.height - 9.0), size: tabSelectorSize) + let tabSelectorFrame = CGRect(origin: CGPoint(x: tabSelectorFrameOriginX, y: size.height - tabSelectorSize.height - 10.0), size: tabSelectorSize) if let tabSelectorView = self.tabSelector.view { if tabSelectorView.superview == nil { self.view.addSubview(tabSelectorView) diff --git a/submodules/ItemListUI/Sources/ItemListControllerTabsContentNode.swift b/submodules/ItemListUI/Sources/ItemListControllerTabsContentNode.swift index 639acc53b9..0e2526e212 100644 --- a/submodules/ItemListUI/Sources/ItemListControllerTabsContentNode.swift +++ b/submodules/ItemListUI/Sources/ItemListControllerTabsContentNode.swift @@ -105,7 +105,7 @@ final class ItemListControllerTabsContentNode: NavigationBarContentNode { environment: {}, containerSize: CGSize(width: size.width, height: 44.0) ) - let tabSelectorFrame = CGRect(origin: CGPoint(x: floor((size.width - tabSelectorSize.width) / 2.0), y: floor((size.height - tabSelectorSize.height) / 2.0) + 4.0), size: tabSelectorSize) + let tabSelectorFrame = CGRect(origin: CGPoint(x: floor((size.width - tabSelectorSize.width) / 2.0), y: floor((size.height - tabSelectorSize.height) / 2.0) + 3.0), size: tabSelectorSize) if let tabSelectorView = self.tabSelector.view { if tabSelectorView.superview == nil { self.view.addSubview(tabSelectorView) diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/SavedMusic.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/SavedMusic.swift index ad7cfafa7e..cf77fdfbb6 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/SavedMusic.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/SavedMusic.swift @@ -250,7 +250,7 @@ public final class ProfileSavedMusicContext { })) } - public func reorderMusic(file: FileMediaReference, file: FileMediaReference?) -> Signal { + public func reorderMusic(file: FileMediaReference, afterFile: FileMediaReference?) -> Signal { return .complete() } diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift index f0946f4fd3..12c3f48fa5 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageGiftBubbleContentNode/Sources/ChatMessageGiftBubbleContentNode.swift @@ -667,7 +667,7 @@ public class ChatMessageGiftBubbleContentNode: ChatMessageBubbleContentNode { authorName = item.message.author.flatMap { EnginePeer($0) }?.compactDisplayTitle ?? "" } if isSelfGift { - title = item.presentationData.strings.Notification_StarGift_Self_Title + title = isStoryEntity ? uniqueGift.title : item.presentationData.strings.Notification_StarGift_Self_Title } else if item.message.id.peerId.isTelegramNotifications { title = item.presentationData.strings.Notification_StarGift_TitleShort } else { diff --git a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift index e4f736ae1a..161a2473f3 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift @@ -3996,10 +3996,12 @@ public class GiftViewScreen: ViewControllerComponentContainer { switch action.action { case let .starGift(gift, convertStars, text, entities, nameHidden, savedToProfile, converted, upgraded, canUpgrade, upgradeStars, isRefunded, _, upgradeMessageId, peerId, senderId, savedId, prepaidUpgradeHash, giftMessageId): var reference: StarGiftReference - if let peerId, let savedId { + if let peerId, let giftMessageId { + reference = .message(messageId: EngineMessage.Id(peerId: peerId, namespace: Namespaces.Message.Cloud, id: giftMessageId)) + } else if let peerId, let savedId { reference = .peer(peerId: peerId, id: savedId) } else { - reference = .message(messageId: giftMessageId.flatMap { EngineMessage.Id(peerId: message.id.peerId, namespace: message.id.namespace, id: $0) } ?? message.id) + reference = .message(messageId: message.id) } return (message.id.peerId, senderId ?? message.author?.id, message.author?.compactDisplayTitle, message.id, reference, message.flags.contains(.Incoming), gift, message.timestamp, convertStars, text, entities, nameHidden, savedToProfile, nil, converted, upgraded, isRefunded, canUpgrade, upgradeStars, nil, nil, nil, upgradeMessageId, nil, nil, prepaidUpgradeHash) case let .starGiftUnique(gift, isUpgrade, isTransferred, savedToProfile, canExportDate, transferStars, _, _, peerId, senderId, savedId, _, canTransferDate, canResaleDate): diff --git a/submodules/TelegramUI/Components/TabSelectorComponent/Sources/TabSelectorComponent.swift b/submodules/TelegramUI/Components/TabSelectorComponent/Sources/TabSelectorComponent.swift index 2b75c31f42..ff20654b6b 100644 --- a/submodules/TelegramUI/Components/TabSelectorComponent/Sources/TabSelectorComponent.swift +++ b/submodules/TelegramUI/Components/TabSelectorComponent/Sources/TabSelectorComponent.swift @@ -611,7 +611,7 @@ public final class TabSelectorComponent: Component { } let itemSize = itemView.title.update( - transition: .immediate, + transition: itemTransition, component: AnyComponent(ItemComponent( context: component.context, content: item.content, @@ -736,7 +736,7 @@ public final class TabSelectorComponent: Component { } var mappedSelectionFrame = effectiveBackgroundRect.insetBy(dx: innerInset, dy: 0.0) - mappedSelectionFrame.origin.y = mappedSelectionFrame.maxY + 6.0 + mappedSelectionFrame.origin.y = mappedSelectionFrame.maxY + 7.0 mappedSelectionFrame.size.height = 3.0 transition.setPosition(view: self.selectionView, position: mappedSelectionFrame.center) transition.setBounds(view: self.selectionView, bounds: CGRect(origin: CGPoint(), size: mappedSelectionFrame.size))