mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
no message
This commit is contained in:
@@ -133,6 +133,8 @@ public func outgoingMessageWithChatContextResult(_ results: ChatContextResultCol
|
||||
case let .internalReference(id, type, title, description, image, file, message):
|
||||
if type == "game" {
|
||||
return .message(text: "", attributes: attributes, media: TelegramMediaGame(gameId: 0, accessHash: 0, name: "", title: title ?? "", description: description ?? "", image: image, file: file), replyToMessageId: nil, localGroupingKey: nil)
|
||||
} else if let file = file, type == "gif" {
|
||||
return .message(text: caption, attributes: attributes, media: file, replyToMessageId: nil, localGroupingKey: nil)
|
||||
} else if let image = image {
|
||||
return .message(text: caption, attributes: attributes, media: image, replyToMessageId: nil, localGroupingKey: nil)
|
||||
} else if let file = file {
|
||||
|
||||
@@ -12,6 +12,7 @@ import Foundation
|
||||
public enum MessageActionCallbackResult {
|
||||
case none
|
||||
case alert(String)
|
||||
case toast(String)
|
||||
case url(String)
|
||||
}
|
||||
|
||||
@@ -35,9 +36,13 @@ public func requestMessageActionCallback(account: Account, messageId: MessageId,
|
||||
//messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;
|
||||
|
||||
switch result {
|
||||
case let .botCallbackAnswer(_, message, url, cacheTime):
|
||||
case let .botCallbackAnswer(flags, message, url, cacheTime):
|
||||
if let message = message {
|
||||
return .alert(message)
|
||||
if (flags & (1 << 1)) != 0 {
|
||||
return .alert(message)
|
||||
} else {
|
||||
return .toast(message)
|
||||
}
|
||||
} else if let url = url {
|
||||
return .url(url)
|
||||
} else {
|
||||
|
||||
@@ -89,10 +89,10 @@ public func searchMessages(account: Account, location: SearchMessagesLocation, q
|
||||
}
|
||||
}
|
||||
case let .group(groupId):
|
||||
remoteSearchResult = account.network.request(Api.functions.channels.searchFeed(feedId: groupId.rawValue, q: query, offsetDate: 0, offsetPeer: Api.InputPeer.inputPeerEmpty, offsetId: 0, limit: 64))
|
||||
remoteSearchResult = account.network.request(Api.functions.channels.searchFeed(feedId: groupId.rawValue, q: query, offsetDate: 0, offsetPeer: Api.InputPeer.inputPeerEmpty, offsetId: 0, limit: 64), automaticFloodWait: false)
|
||||
|> mapError { _ in } |> map(Optional.init)
|
||||
case .general:
|
||||
remoteSearchResult = account.network.request(Api.functions.messages.searchGlobal(q: query, offsetDate: 0, offsetPeer: Api.InputPeer.inputPeerEmpty, offsetId: 0, limit: 64))
|
||||
remoteSearchResult = account.network.request(Api.functions.messages.searchGlobal(q: query, offsetDate: 0, offsetPeer: Api.InputPeer.inputPeerEmpty, offsetId: 0, limit: 64), automaticFloodWait: false)
|
||||
|> mapError { _ in } |> map(Optional.init)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user