mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Fix inline bots error handling
This commit is contained in:
@@ -14,6 +14,7 @@ import DeviceLocationManager
|
||||
import TelegramNotices
|
||||
|
||||
enum ChatContextQueryError {
|
||||
case generic
|
||||
case inlineBotLocationRequest(PeerId)
|
||||
}
|
||||
|
||||
@@ -296,7 +297,12 @@ private func updatedContextQueryResultStateForQuery(context: AccountContext, pee
|
||||
}
|
||||
} ?? .single(nil), offset: "")
|
||||
|> mapError { error -> ChatContextQueryError in
|
||||
return .inlineBotLocationRequest(user.id)
|
||||
switch error {
|
||||
case .generic:
|
||||
return .generic
|
||||
case .locationRequired:
|
||||
return .inlineBotLocationRequest(user.id)
|
||||
}
|
||||
}
|
||||
|> map { results -> (ChatPresentationInputQueryResult?) -> ChatPresentationInputQueryResult? in
|
||||
return { _ in
|
||||
|
||||
Reference in New Issue
Block a user