Update API [skip ci]

This commit is contained in:
Ilya Laktyushin
2024-11-07 14:01:54 +01:00
parent 9a46522b43
commit 8ec6964dfe
9 changed files with 110 additions and 26 deletions

View File

@@ -56,6 +56,9 @@ func _internal_requestSimpleWebView(postbox: Postbox, network: Network, botId: P
if (flags & (1 << 1)) != 0 {
resultFlags.insert(.fullSize)
}
if (flags & (1 << 2)) != 0 {
resultFlags.insert(.fullScreen)
}
return .single(RequestWebViewResult(flags: resultFlags, queryId: queryId, url: url, keepAliveSignal: nil))
}
}
@@ -103,6 +106,9 @@ func _internal_requestMainWebView(postbox: Postbox, network: Network, botId: Pee
if (flags & (1 << 1)) != 0 {
resultFlags.insert(.fullSize)
}
if (flags & (1 << 2)) != 0 {
resultFlags.insert(.fullScreen)
}
return .single(RequestWebViewResult(flags: resultFlags, queryId: queryId, url: url, keepAliveSignal: nil))
}
}
@@ -128,6 +134,7 @@ public struct RequestWebViewResult {
}
public static let fullSize = Flags(rawValue: 1 << 0)
public static let fullScreen = Flags(rawValue: 1 << 1)
}
public let flags: Flags
@@ -237,6 +244,9 @@ func _internal_requestWebView(postbox: Postbox, network: Network, stateManager:
if (webViewFlags & (1 << 1)) != 0 {
resultFlags.insert(.fullSize)
}
if (flags & (1 << 2)) != 0 {
resultFlags.insert(.fullScreen)
}
let keepAlive: Signal<Never, KeepWebViewError>?
if let queryId {
keepAlive = keepWebViewSignal(network: network, stateManager: stateManager, flags: flags, peer: inputPeer, bot: inputBot, queryId: queryId, replyToMessageId: replyToMessageId, threadId: threadId, sendAs: nil)
@@ -323,6 +333,9 @@ func _internal_requestAppWebView(postbox: Postbox, network: Network, stateManage
if (flags & (1 << 1)) != 0 {
resultFlags.insert(.fullSize)
}
if (flags & (1 << 2)) != 0 {
resultFlags.insert(.fullScreen)
}
return .single(RequestWebViewResult(flags: resultFlags, queryId: queryId, url: url, keepAliveSignal: nil))
}
}