diff --git a/Swiftgram/SGIQTP/Sources/SGIQTP.swift b/Swiftgram/SGIQTP/Sources/SGIQTP.swift index 794d92897c..529b417486 100644 --- a/Swiftgram/SGIQTP/Sources/SGIQTP.swift +++ b/Swiftgram/SGIQTP/Sources/SGIQTP.swift @@ -29,7 +29,7 @@ public func sgIqtpQuery(engine: TelegramEngine, query: String, incompleteResults #else SGLogger.shared.log("SGIQTP", "[\(queryId)] Query") #endif - return engine.peers.resolvePeerByName(forIQTP: true, name: SG_CONFIG.botUsername, referrer: nil) + return engine.peers.resolvePeerByName(name: SG_CONFIG.botUsername, referrer: nil) |> mapToSignal { result -> Signal in guard case let .result(result) = result else { SGLogger.shared.log("SGIQTP", "[\(queryId)] Failed to resolve peer \(SG_CONFIG.botUsername)") diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/RequestChatContextResults.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/RequestChatContextResults.swift index ea151b836f..4165f16b18 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/RequestChatContextResults.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/RequestChatContextResults.swift @@ -52,7 +52,7 @@ public struct RequestChatContextResultsResult { } } -func _internal_requestChatContextResults(forIQTP: Bool = false, account: Account, botId: PeerId, peerId: PeerId, query: String, location: Signal<(Double, Double)?, NoError> = .single(nil), offset: String, incompleteResults: Bool = false, staleCachedResults: Bool = false) -> Signal { +func _internal_requestChatContextResults(account: Account, botId: PeerId, peerId: PeerId, query: String, location: Signal<(Double, Double)?, NoError> = .single(nil), offset: String, incompleteResults: Bool = false, staleCachedResults: Bool = false) -> Signal { return account.postbox.transaction { transaction -> (bot: Peer, peer: Peer)? in if let bot = transaction.getPeer(botId), let peer = transaction.getPeer(peerId) { return (bot, peer) @@ -77,7 +77,7 @@ func _internal_requestChatContextResults(forIQTP: Bool = false, account: Account return .single(nil) } - return account.postbox.transaction(ignoreDisabled: forIQTP) { transaction -> Signal in + return account.postbox.transaction { transaction -> Signal in var staleResult: RequestChatContextResultsResult? if offset.isEmpty && location == nil { @@ -139,7 +139,7 @@ func _internal_requestChatContextResults(forIQTP: Bool = false, account: Account return .single(nil) } - return account.postbox.transaction(ignoreDisabled: forIQTP) { transaction -> RequestChatContextResultsResult? in + return account.postbox.transaction { transaction -> RequestChatContextResultsResult? in if result.cacheTimeout > 10, offset.isEmpty && location == nil { if let resultData = try? JSONEncoder().encode(result) { let requestData = RequestData(version: requestVersion, botId: botId, peerId: peerId, query: query) diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift index caacfe0ba6..c0acab773b 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift @@ -361,8 +361,8 @@ public extension TelegramEngine { return _internal_updateStarsReactionIsAnonymous(account: self.account, messageId: id, isAnonymous: isAnonymous) } - public func requestChatContextResults(forIQTP: Bool = false, botId: PeerId, peerId: PeerId, query: String, location: Signal<(Double, Double)?, NoError> = .single(nil), offset: String, incompleteResults: Bool = false, staleCachedResults: Bool = false) -> Signal { - return _internal_requestChatContextResults(forIQTP: Bool = false, account: self.account, botId: botId, peerId: peerId, query: query, location: location, offset: offset, incompleteResults: incompleteResults, staleCachedResults: staleCachedResults) + public func requestChatContextResults(botId: PeerId, peerId: PeerId, query: String, location: Signal<(Double, Double)?, NoError> = .single(nil), offset: String, incompleteResults: Bool = false, staleCachedResults: Bool = false) -> Signal { + return _internal_requestChatContextResults(account: self.account, botId: botId, peerId: peerId, query: query, location: location, offset: offset, incompleteResults: incompleteResults, staleCachedResults: staleCachedResults) } public func removeRecentlyUsedHashtag(string: String) -> Signal { diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/TelegramEnginePeers.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/TelegramEnginePeers.swift index 89fc400c35..b716f47008 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/TelegramEnginePeers.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/TelegramEnginePeers.swift @@ -179,7 +179,7 @@ public extension TelegramEngine { return _internal_inactiveChannelList(network: self.account.network) } - public func resolvePeerByName(forIQTP: Bool = false, name: String, referrer: String?, ageLimit: Int32 = 2 * 60 * 60 * 24) -> Signal { + public func resolvePeerByName(name: String, referrer: String?, ageLimit: Int32 = 2 * 60 * 60 * 24) -> Signal { return _internal_resolvePeerByName(account: self.account, name: name, referrer: referrer, ageLimit: ageLimit) |> mapToSignal { result -> Signal in switch result { @@ -189,7 +189,7 @@ public extension TelegramEngine { guard let peerId = peerId else { return .single(.result(nil)) } - return self.account.postbox.transaction(ignoreDisabled: forIQTP) { transaction -> ResolvePeerResult in + return self.account.postbox.transaction { transaction -> ResolvePeerResult in return .result(transaction.getPeer(peerId).flatMap(EnginePeer.init)) } }