Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Mikhail Filimonov 2025-04-10 15:40:53 +04:00
commit 1d67c6f8dc
4 changed files with 16 additions and 7 deletions

View File

@ -237,7 +237,7 @@ private final class QuickShareToastScreenComponent: Component {
transition: .immediate,
component: AnyComponent(PlainButtonComponent(
content: AnyComponent(MultilineTextComponent(
text: .plain(NSAttributedString(string: "Undo", font: Font.regular(17.0), textColor: environment.theme.list.itemAccentColor.withMultiplied(hue: 0.933, saturation: 0.61, brightness: 1.0)))
text: .plain(NSAttributedString(string: component.peer.id != component.context.account.peerId ? environment.strings.Undo_Undo : "", font: Font.regular(17.0), textColor: environment.theme.list.itemAccentColor.withMultiplied(hue: 0.933, saturation: 0.61, brightness: 1.0)))
)),
effectAlignment: .center,
contentInsets: UIEdgeInsets(top: -8.0, left: -8.0, bottom: -8.0, right: -8.0),
@ -267,7 +267,7 @@ private final class QuickShareToastScreenComponent: Component {
linkAttribute: { _ in return nil })
))),
environment: {},
containerSize: CGSize(width: availableContentSize.width - contentInsets.left - contentInsets.right - spacing - iconSize.width - 16.0, height: availableContentSize.height)
containerSize: CGSize(width: availableContentSize.width - contentInsets.left - contentInsets.right - spacing - iconSize.width - actionButtonSize.width - 16.0 - 4.0, height: availableContentSize.height)
)
var contentHeight: CGFloat = 0.0

View File

@ -11118,7 +11118,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
giftsContext?.updateSorting(sorting == .date ? .value : .date)
})))
if hasPinnedGifts {
if hasPinnedGifts && hasVisibility {
items.append(.action(ContextMenuActionItem(text: strings.PeerInfo_Gifts_Reorder, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/ReorderItems"), color: theme.contextMenu.primaryColor)
}, action: { _, f in

View File

@ -28,8 +28,6 @@ func metalLibrary(device: MTLDevice) -> MTLLibrary? {
return library
}
final class StoryBlobLayer: MetalEngineSubjectLayer, MetalEngineSubject {
var internalData: MetalEngineSubjectInternalData?

View File

@ -5754,6 +5754,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
} else {
displayedPeerVerification = .single(false)
}
let globalPrivacySettings = context.engine.data.get(TelegramEngine.EngineData.Item.Configuration.GlobalPrivacy())
self.peerDisposable.set(combineLatest(
queue: Queue.mainQueue(),
@ -5769,8 +5771,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
isPremiumRequiredForMessaging,
managingBot,
adMessage,
displayedPeerVerification
).startStrict(next: { [weak self] peerView, globalNotificationSettings, onlineMemberCount, hasScheduledMessages, peerReportNotice, pinnedCount, threadInfo, hasSearchTags, hasSavedChats, isPremiumRequiredForMessaging, managingBot, adMessage, displayedPeerVerification in
displayedPeerVerification,
globalPrivacySettings
).startStrict(next: { [weak self] peerView, globalNotificationSettings, onlineMemberCount, hasScheduledMessages, peerReportNotice, pinnedCount, threadInfo, hasSearchTags, hasSavedChats, isPremiumRequiredForMessaging, managingBot, adMessage, displayedPeerVerification, globalPrivacySettings in
if let strongSelf = self {
if strongSelf.peerView === peerView && strongSelf.reportIrrelvantGeoNotice == peerReportNotice && strongSelf.hasScheduledMessages == hasScheduledMessages && strongSelf.threadInfo == threadInfo && strongSelf.presentationInterfaceState.hasSearchTags == hasSearchTags && strongSelf.presentationInterfaceState.hasSavedChats == hasSavedChats && strongSelf.presentationInterfaceState.isPremiumRequiredForMessaging == isPremiumRequiredForMessaging && managingBot == strongSelf.presentationInterfaceState.contactStatus?.managingBot && adMessage?.id == strongSelf.presentationInterfaceState.adMessage?.id {
return
@ -5869,6 +5872,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
var contactStatus: ChatContactStatus?
var businessIntro: TelegramBusinessIntro?
var sendPaidMessageStars: StarsAmount?
var alwaysShowGiftButton = false
var disallowedGifts: TelegramDisallowedGifts?
if let peer = peerView.peers[peerView.peerId] {
if let cachedData = peerView.cachedData as? CachedUserData {
contactStatus = ChatContactStatus(canAddContact: !peerView.peerIsContact, canReportIrrelevantLocation: false, peerStatusSettings: cachedData.peerStatusSettings, invitedBy: nil, managingBot: managingBot)
@ -5878,6 +5883,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
if case let .peer(peerId) = chatLocation, peerId.namespace == Namespaces.Peer.SecretChat {
} else {
sendPaidMessageStars = cachedData.sendPaidMessageStars
if cachedData.disallowedGifts != .All {
alwaysShowGiftButton = globalPrivacySettings.displayGiftButton || cachedData.flags.contains(.displayGiftButton)
}
disallowedGifts = cachedData.disallowedGifts
}
} else if let cachedData = peerView.cachedData as? CachedGroupData {
var invitedBy: Peer?
@ -6113,6 +6122,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
.updatedHasSearchTags(hasSearchTags)
.updatedIsPremiumRequiredForMessaging(isPremiumRequiredForMessaging)
.updatedSendPaidMessageStars(sendPaidMessageStars)
.updatedAlwaysShowGiftButton(alwaysShowGiftButton)
.updatedDisallowedGifts(disallowedGifts)
.updatedHasSavedChats(hasSavedChats)
.updatedAppliedBoosts(appliedBoosts)
.updatedBoostsToUnrestrict(boostsToUnrestrict)