diff --git a/submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift b/submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift index ca874a2f6e..a100512a62 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift @@ -592,7 +592,7 @@ private func privacyAndSecurityControllerEntries( entries.append(.groupPrivacy(presentationData.theme, presentationData.strings.Privacy_GroupsAndChannels, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.groupInvitations))) if !isPremiumDisabled { entries.append(.voiceMessagePrivacy(presentationData.theme, presentationData.strings.Privacy_VoiceMessages, stringForSelectiveSettings(strings: presentationData.strings, settings: privacySettings.voiceMessages), !isPremium)) - //entries.append(.messagePrivacy(privacySettings.globalSettings.nonContactChatsRequirePremium)) + entries.append(.messagePrivacy(privacySettings.globalSettings.nonContactChatsRequirePremium)) } } else { entries.append(.phoneNumberPrivacy(presentationData.theme, presentationData.strings.PrivacySettings_PhoneNumber, presentationData.strings.Channel_NotificationLoading)) diff --git a/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsController.swift b/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsController.swift index ad1a65c520..93a6103c96 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsController.swift @@ -846,7 +846,7 @@ private func selectivePrivacySettingsControllerEntries(presentationData: Present entries.append(.publicPhotoInfo(presentationData.theme, presentationData.strings.Privacy_ProfilePhoto_PublicPhotoInfo)) } - /*if case .presence = kind, let peer { + if case .presence = kind, let peer { entries.append(.hideReadTime(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTime, state.hideReadTimeEnabled == true)) entries.append(.hideReadTimeInfo(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimeFooter)) @@ -854,7 +854,7 @@ private func selectivePrivacySettingsControllerEntries(presentationData: Present entries.append(.subscribeToPremium(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimePremium)) entries.append(.subscribeToPremiumInfo(presentationData.theme, presentationData.strings.Settings_Privacy_ReadTimePremiumFooter)) } - }*/ + } return entries } diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index cf9bdd414b..54f3b0acb3 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -594,6 +594,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[577659656] = { return Api.NotifyPeer.parse_notifyForumTopic($0) } dict[-1613493288] = { return Api.NotifyPeer.parse_notifyPeer($0) } dict[-1261946036] = { return Api.NotifyPeer.parse_notifyUsers($0) } + dict[1001931436] = { return Api.OutboxReadDate.parse_outboxReadDate($0) } dict[-1738178803] = { return Api.Page.parse_page($0) } dict[-837994576] = { return Api.PageBlock.parse_pageBlockAnchor($0) } dict[-2143067670] = { return Api.PageBlock.parse_pageBlockAudio($0) } @@ -994,11 +995,11 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-2100168954] = { return Api.UserProfilePhoto.parse_userProfilePhoto($0) } dict[1326562017] = { return Api.UserProfilePhoto.parse_userProfilePhotoEmpty($0) } dict[164646985] = { return Api.UserStatus.parse_userStatusEmpty($0) } - dict[2011940674] = { return Api.UserStatus.parse_userStatusLastMonth($0) } - dict[129960444] = { return Api.UserStatus.parse_userStatusLastWeek($0) } + dict[1703516023] = { return Api.UserStatus.parse_userStatusLastMonth($0) } + dict[1410997530] = { return Api.UserStatus.parse_userStatusLastWeek($0) } dict[9203775] = { return Api.UserStatus.parse_userStatusOffline($0) } dict[-306628279] = { return Api.UserStatus.parse_userStatusOnline($0) } - dict[-496024847] = { return Api.UserStatus.parse_userStatusRecently($0) } + dict[2065268168] = { return Api.UserStatus.parse_userStatusRecently($0) } dict[-1274595769] = { return Api.Username.parse_username($0) } dict[-567037804] = { return Api.VideoSize.parse_videoSize($0) } dict[-128171716] = { return Api.VideoSize.parse_videoSizeEmojiMarkup($0) } @@ -1653,6 +1654,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.NotifyPeer: _1.serialize(buffer, boxed) + case let _1 as Api.OutboxReadDate: + _1.serialize(buffer, boxed) case let _1 as Api.Page: _1.serialize(buffer, boxed) case let _1 as Api.PageBlock: diff --git a/submodules/TelegramApi/Sources/Api15.swift b/submodules/TelegramApi/Sources/Api15.swift index d71cc7f9fe..278c569f5c 100644 --- a/submodules/TelegramApi/Sources/Api15.swift +++ b/submodules/TelegramApi/Sources/Api15.swift @@ -98,6 +98,42 @@ public extension Api { } } +public extension Api { + enum OutboxReadDate: TypeConstructorDescription { + case outboxReadDate(date: Int32) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .outboxReadDate(let date): + if boxed { + buffer.appendInt32(1001931436) + } + serializeInt32(date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .outboxReadDate(let date): + return ("outboxReadDate", [("date", date as Any)]) + } + } + + public static func parse_outboxReadDate(_ reader: BufferReader) -> OutboxReadDate? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.OutboxReadDate.outboxReadDate(date: _1!) + } + else { + return nil + } + } + + } +} public extension Api { enum Page: TypeConstructorDescription { case page(flags: Int32, url: String, blocks: [Api.PageBlock], photos: [Api.Photo], documents: [Api.Document], views: Int32?) diff --git a/submodules/TelegramApi/Sources/Api23.swift b/submodules/TelegramApi/Sources/Api23.swift index ae4e12ba96..2d684d02d3 100644 --- a/submodules/TelegramApi/Sources/Api23.swift +++ b/submodules/TelegramApi/Sources/Api23.swift @@ -801,11 +801,11 @@ public extension Api { public extension Api { enum UserStatus: TypeConstructorDescription { case userStatusEmpty - case userStatusLastMonth - case userStatusLastWeek + case userStatusLastMonth(flags: Int32) + case userStatusLastWeek(flags: Int32) case userStatusOffline(wasOnline: Int32) case userStatusOnline(expires: Int32) - case userStatusRecently + case userStatusRecently(flags: Int32) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { @@ -815,17 +815,17 @@ public extension Api { } break - case .userStatusLastMonth: + case .userStatusLastMonth(let flags): if boxed { - buffer.appendInt32(2011940674) + buffer.appendInt32(1703516023) } - + serializeInt32(flags, buffer: buffer, boxed: false) break - case .userStatusLastWeek: + case .userStatusLastWeek(let flags): if boxed { - buffer.appendInt32(129960444) + buffer.appendInt32(1410997530) } - + serializeInt32(flags, buffer: buffer, boxed: false) break case .userStatusOffline(let wasOnline): if boxed { @@ -839,11 +839,11 @@ public extension Api { } serializeInt32(expires, buffer: buffer, boxed: false) break - case .userStatusRecently: + case .userStatusRecently(let flags): if boxed { - buffer.appendInt32(-496024847) + buffer.appendInt32(2065268168) } - + serializeInt32(flags, buffer: buffer, boxed: false) break } } @@ -852,16 +852,16 @@ public extension Api { switch self { case .userStatusEmpty: return ("userStatusEmpty", []) - case .userStatusLastMonth: - return ("userStatusLastMonth", []) - case .userStatusLastWeek: - return ("userStatusLastWeek", []) + case .userStatusLastMonth(let flags): + return ("userStatusLastMonth", [("flags", flags as Any)]) + case .userStatusLastWeek(let flags): + return ("userStatusLastWeek", [("flags", flags as Any)]) case .userStatusOffline(let wasOnline): return ("userStatusOffline", [("wasOnline", wasOnline as Any)]) case .userStatusOnline(let expires): return ("userStatusOnline", [("expires", expires as Any)]) - case .userStatusRecently: - return ("userStatusRecently", []) + case .userStatusRecently(let flags): + return ("userStatusRecently", [("flags", flags as Any)]) } } @@ -869,10 +869,26 @@ public extension Api { return Api.UserStatus.userStatusEmpty } public static func parse_userStatusLastMonth(_ reader: BufferReader) -> UserStatus? { - return Api.UserStatus.userStatusLastMonth + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.UserStatus.userStatusLastMonth(flags: _1!) + } + else { + return nil + } } public static func parse_userStatusLastWeek(_ reader: BufferReader) -> UserStatus? { - return Api.UserStatus.userStatusLastWeek + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.UserStatus.userStatusLastWeek(flags: _1!) + } + else { + return nil + } } public static func parse_userStatusOffline(_ reader: BufferReader) -> UserStatus? { var _1: Int32? @@ -897,7 +913,15 @@ public extension Api { } } public static func parse_userStatusRecently(_ reader: BufferReader) -> UserStatus? { - return Api.UserStatus.userStatusRecently + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.UserStatus.userStatusRecently(flags: _1!) + } + else { + return nil + } } } diff --git a/submodules/TelegramApi/Sources/Api32.swift b/submodules/TelegramApi/Sources/Api32.swift index 3f776e0c0e..a09ade3911 100644 --- a/submodules/TelegramApi/Sources/Api32.swift +++ b/submodules/TelegramApi/Sources/Api32.swift @@ -5655,6 +5655,22 @@ public extension Api.functions.messages { }) } } +public extension Api.functions.messages { + static func getOutboxReadDate(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1941176739) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getOutboxReadDate", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.OutboxReadDate? in + let reader = BufferReader(buffer) + var result: Api.OutboxReadDate? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.OutboxReadDate + } + return result + }) + } +} public extension Api.functions.messages { static func getPeerDialogs(peers: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() @@ -9697,6 +9713,25 @@ public extension Api.functions.users { }) } } +public extension Api.functions.users { + static func getIsPremiumRequiredToContact(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.Bool]>) { + let buffer = Buffer() + buffer.appendInt32(-1507677680) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "users.getIsPremiumRequiredToContact", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Bool]? in + let reader = BufferReader(buffer) + var result: [Api.Bool]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.Bool.self) + } + return result + }) + } +} public extension Api.functions.users { static func getUsers(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.User]>) { let buffer = Buffer() diff --git a/submodules/TelegramCore/Sources/ApiUtils/TelegramUserPresence.swift b/submodules/TelegramCore/Sources/ApiUtils/TelegramUserPresence.swift index 07de3d66d2..df313c16c1 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/TelegramUserPresence.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/TelegramUserPresence.swift @@ -12,14 +12,14 @@ extension TelegramUserPresence { self.init(status: .present(until: expires), lastActivity: 0) case let .userStatusOffline(wasOnline): self.init(status: .present(until: wasOnline), lastActivity: 0) - case .userStatusRecently: - let isHidden = false//(flags & (1 << 0)) != 0 + case let .userStatusRecently(flags): + let isHidden = (flags & (1 << 0)) != 0 self.init(status: .recently(isHidden: isHidden), lastActivity: 0) - case .userStatusLastWeek: - let isHidden = false//(flags & (1 << 0)) != 0 + case let .userStatusLastWeek(flags): + let isHidden = (flags & (1 << 0)) != 0 self.init(status: .lastWeek(isHidden: isHidden), lastActivity: 0) - case .userStatusLastMonth: - let isHidden = false//(flags & (1 << 0)) != 0 + case let .userStatusLastMonth(flags): + let isHidden = (flags & (1 << 0)) != 0 self.init(status: .lastMonth(isHidden: isHidden), lastActivity: 0) } } diff --git a/submodules/TelegramCore/Sources/State/AccountViewTracker.swift b/submodules/TelegramCore/Sources/State/AccountViewTracker.swift index 10ead4d052..6b36ad4e3b 100644 --- a/submodules/TelegramCore/Sources/State/AccountViewTracker.swift +++ b/submodules/TelegramCore/Sources/State/AccountViewTracker.swift @@ -1388,7 +1388,7 @@ public final class AccountViewTracker { } private func internalRefreshCanSendMessagesStatsForPeerIds(peerIds: [PeerId]) { - /*self.queue.async { + self.queue.async { var addedPeerIds: [PeerId] = [] let timestamp = Int32(CFAbsoluteTimeGetCurrent()) for peerId in peerIds { @@ -1472,7 +1472,7 @@ public final class AccountViewTracker { self.updatedUnsupportedMediaDisposables.set(signal.start(), forKey: disposableId) } } - }*/ + } } public func updateMarkAllMentionsSeen(peerId: PeerId, threadId: Int64?) { @@ -2326,9 +2326,6 @@ public final class AccountViewTracker { } } var reactionCount: Int32 = 0 - /*if let view = views.views[pendingReactionsKey] as? PendingMessageActionsSummaryView { - reactionCount -= view.count - }*/ if let view = views.views[summaryReactionsKey] as? MessageHistoryTagSummaryView { if let unseenCount = view.count { reactionCount += unseenCount diff --git a/submodules/TelegramCore/Sources/State/PremiumRequiredToContact.swift b/submodules/TelegramCore/Sources/State/PremiumRequiredToContact.swift index 70b47ae437..c13048bf8c 100644 --- a/submodules/TelegramCore/Sources/State/PremiumRequiredToContact.swift +++ b/submodules/TelegramCore/Sources/State/PremiumRequiredToContact.swift @@ -3,8 +3,7 @@ import Postbox import TelegramApi internal func _internal_updateIsPremiumRequiredToContact(account: Account, peerIds: [EnginePeer.Id]) -> Signal<[EnginePeer.Id], NoError> { - return .single([]) - /*return account.postbox.transaction { transaction -> ([Api.InputUser], [PeerId]) in + return account.postbox.transaction { transaction -> ([Api.InputUser], [PeerId]) in var inputUsers: [Api.InputUser] = [] var premiumRequired:[EnginePeer.Id] = [] for id in peerIds { @@ -51,7 +50,5 @@ internal func _internal_updateIsPremiumRequiredToContact(account: Account, peerI } else { return .single(premiumRequired) } - - - }*/ + } } diff --git a/submodules/TelegramCore/Sources/State/Serialization.swift b/submodules/TelegramCore/Sources/State/Serialization.swift index 3ef225aaab..51506fd6da 100644 --- a/submodules/TelegramCore/Sources/State/Serialization.swift +++ b/submodules/TelegramCore/Sources/State/Serialization.swift @@ -210,7 +210,7 @@ public class BoxedMessage: NSObject { public class Serialization: NSObject, MTSerialization { public func currentLayer() -> UInt { - return 171 + return 173 } public func parseMessage(_ data: Data!) -> Any! { diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/MessageReadStats.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/MessageReadStats.swift index 83ec6f7dc3..8011bd6fae 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/MessageReadStats.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/MessageReadStats.swift @@ -27,8 +27,7 @@ func _internal_messageReadStats(account: Account, id: MessageId) -> Signal map(Optional.init) |> `catch` { _ -> Signal in return .single(nil) @@ -41,7 +40,7 @@ func _internal_messageReadStats(account: Account, id: MessageId) -> Signal = account.network.request(Api.functions.messages.getMessageReadParticipants(peer: inputPeer, msgId: id.id)) |> map { result -> [(Int64, Int32)]? in diff --git a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift index 01c1188404..22173d47cb 100644 --- a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift +++ b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift @@ -489,16 +489,14 @@ public extension Message { public extension Message { func areReactionsTags(accountPeerId: PeerId) -> Bool { - return false - - /*if self.id.peerId == accountPeerId { + if self.id.peerId == accountPeerId { if let reactionsAttribute = self.reactionsAttribute, !reactionsAttribute.reactions.isEmpty { return reactionsAttribute.isTags } else { return true } } - return false*/ + return false } } diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index c031ddad32..e0ba51e1c8 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -2656,7 +2656,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate { var activate = false if self.searchNavigationNode == nil { activate = true - self.searchNavigationNode = ChatSearchNavigationContentNode(context: self.context, theme: self.chatPresentationInterfaceState.theme, strings: self.chatPresentationInterfaceState.strings, chatLocation: self.chatPresentationInterfaceState.chatLocation, interaction: interfaceInteraction) + self.searchNavigationNode = ChatSearchNavigationContentNode(context: self.context, theme: self.chatPresentationInterfaceState.theme, strings: self.chatPresentationInterfaceState.strings, chatLocation: self.chatPresentationInterfaceState.chatLocation, interaction: interfaceInteraction, presentationInterfaceState: self.chatPresentationInterfaceState) } self.navigationBar?.setContentNode(self.searchNavigationNode, animated: transitionIsAnimated) self.searchNavigationNode?.update(presentationInterfaceState: self.chatPresentationInterfaceState) diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift index f8ee7eec23..ce41b22454 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift @@ -251,9 +251,6 @@ private func canViewReadStats(message: Message, participantCount: Int?, isMessag if user.flags.contains(.isSupport) { return false } - if "".isEmpty { - return false - } default: return false } diff --git a/submodules/TelegramUI/Sources/ChatInterfaceTitlePanelNodes.swift b/submodules/TelegramUI/Sources/ChatInterfaceTitlePanelNodes.swift index 156a8bffa9..6f587c3f06 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceTitlePanelNodes.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceTitlePanelNodes.swift @@ -12,7 +12,7 @@ func titlePanelForChatPresentationInterfaceState(_ chatPresentationInterfaceStat if chatPresentationInterfaceState.renderedPeer?.peer?.restrictionText(platform: "ios", contentSettings: context.currentContentSettings.with { $0 }) != nil { return nil } - /*if let search = chatPresentationInterfaceState.search { + if let search = chatPresentationInterfaceState.search, chatPresentationInterfaceState.hasSearchTags { if chatPresentationInterfaceState.chatLocation.peerId == context.account.peerId, case .everything = search.domain { if let currentPanel = currentPanel as? ChatSearchTitleAccessoryPanelNode { return currentPanel @@ -24,7 +24,7 @@ func titlePanelForChatPresentationInterfaceState(_ chatPresentationInterfaceStat } else { return nil } - }*/ + } var inhibitTitlePanelDisplay = false switch chatPresentationInterfaceState.subject { diff --git a/submodules/TelegramUI/Sources/ChatSearchNavigationContentNode.swift b/submodules/TelegramUI/Sources/ChatSearchNavigationContentNode.swift index b441e5bb86..35bbdc093c 100644 --- a/submodules/TelegramUI/Sources/ChatSearchNavigationContentNode.swift +++ b/submodules/TelegramUI/Sources/ChatSearchNavigationContentNode.swift @@ -24,7 +24,7 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode { private var searchingActivityDisposable: Disposable? - init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, chatLocation: ChatLocation, interaction: ChatPanelInterfaceInteraction) { + init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, chatLocation: ChatLocation, interaction: ChatPanelInterfaceInteraction, presentationInterfaceState: ChatPresentationInterfaceState) { self.context = context self.theme = theme self.strings = strings @@ -35,7 +35,7 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode { let placeholderText: String switch chatLocation { case .peer, .replyThread, .feed: - if chatLocation.peerId == context.account.peerId, !"".isEmpty { + if chatLocation.peerId == context.account.peerId, presentationInterfaceState.hasSearchTags { placeholderText = strings.Chat_SearchTagsPlaceholder } else { placeholderText = strings.Conversation_SearchPlaceholder @@ -113,7 +113,7 @@ final class ChatSearchNavigationContentNode: NavigationBarContentNode { case .peer, .replyThread, .feed: if presentationInterfaceState.historyFilter != nil { placeholderText = self.strings.Common_Search - } else if self.chatLocation.peerId == self.context.account.peerId, !"".isEmpty { + } else if self.chatLocation.peerId == self.context.account.peerId, presentationInterfaceState.hasSearchTags { placeholderText = self.strings.Chat_SearchTagsPlaceholder } else { placeholderText = self.strings.Conversation_SearchPlaceholder diff --git a/submodules/TemporaryCachedPeerDataManager/Sources/PeerChannelMemberCategoriesContextsManager.swift b/submodules/TemporaryCachedPeerDataManager/Sources/PeerChannelMemberCategoriesContextsManager.swift index 5ffcb23986..005634bca0 100644 --- a/submodules/TemporaryCachedPeerDataManager/Sources/PeerChannelMemberCategoriesContextsManager.swift +++ b/submodules/TemporaryCachedPeerDataManager/Sources/PeerChannelMemberCategoriesContextsManager.swift @@ -222,12 +222,14 @@ private final class PeerChannelMemberCategoriesContextsManagerImpl { self.profileDataPhotoPreloadContexts[peerId] = context disposable.set(fetch.start(next: { [weak context] value in - guard let context = context else { - return - } - context.value = value - for f in context.subscribers.copyItems() { - f(value) + Queue.mainQueue().async { + guard let context = context else { + return + } + context.value = value + for f in context.subscribers.copyItems() { + f(value) + } } })) }