From 97b8a1c3091337cf05c448c9e1334c7434950093 Mon Sep 17 00:00:00 2001 From: Mike Renoir <> Date: Tue, 24 Oct 2023 19:39:01 +0400 Subject: [PATCH] macos syntax --- .../TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift | 2 +- .../Sources/State/AccountStateManagementUtils.swift | 2 +- .../TelegramCore/Sources/State/ManagedAccountPresence.swift | 2 +- .../Sources/TelegramEngine/Payments/GiftCodes.swift | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift b/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift index e32283b2f7..aa8b7fb981 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift @@ -709,7 +709,7 @@ extension StoreMessage { if mediaValue is TelegramMediaWebpage { let leadingPreview = (flags & (1 << 27)) != 0 - if let webpageAttributes { + if let webpageAttributes = webpageAttributes { attributes.append(WebpagePreviewMessageAttribute(leadingPreview: leadingPreview, forceLargeMedia: webpageAttributes.forceLargeMedia, isManuallyAdded: webpageAttributes.isManuallyAdded, isSafe: webpageAttributes.isSafe)) } } diff --git a/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift b/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift index 1e4c226452..8f1d291d91 100644 --- a/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift +++ b/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift @@ -1153,7 +1153,7 @@ private func finalStateWithUpdatesAndServerTime(accountPeerId: PeerId, postbox: medias.append(mediaValue) if mediaValue is TelegramMediaWebpage { - if let webpageAttributes { + if let webpageAttributes = webpageAttributes { attributes.append(WebpagePreviewMessageAttribute(leadingPreview: false, forceLargeMedia: webpageAttributes.forceLargeMedia, isManuallyAdded: webpageAttributes.isManuallyAdded, isSafe: webpageAttributes.isSafe)) } } diff --git a/submodules/TelegramCore/Sources/State/ManagedAccountPresence.swift b/submodules/TelegramCore/Sources/State/ManagedAccountPresence.swift index 445008c1b9..8c8a4fa31d 100644 --- a/submodules/TelegramCore/Sources/State/ManagedAccountPresence.swift +++ b/submodules/TelegramCore/Sources/State/ManagedAccountPresence.swift @@ -25,7 +25,7 @@ private final class AccountPresenceManagerImpl { self.shouldKeepOnlinePresenceDisposable = (shouldKeepOnlinePresence |> distinctUntilChanged |> deliverOn(self.queue)).start(next: { [weak self] value in - guard let self else { + guard let `self` = self else { return } if self.wasOnline != value { diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Payments/GiftCodes.swift b/submodules/TelegramCore/Sources/TelegramEngine/Payments/GiftCodes.swift index 82d096254f..1476796827 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Payments/GiftCodes.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Payments/GiftCodes.swift @@ -104,7 +104,7 @@ func _internal_getPremiumGiveawayInfo(account: Account, peerId: EnginePeer.Id, m return .single(nil) } |> map { result -> PremiumGiveawayInfo? in - if let result { + if let result = result { switch result { case let .giveawayInfo(flags, startDate, joinedTooEarlyDate, adminDisallowedChatId, disallowedCountry): if (flags & (1 << 3)) != 0 {