mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Proof of concept webview attach menu support.
This commit is contained in:
@@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/layers/layer_widget.h"
|
||||
#include "ui/layers/show.h"
|
||||
#include "window/window_adaptive.h"
|
||||
#include "mtproto/sender.h"
|
||||
|
||||
class PhotoData;
|
||||
class MainWidget;
|
||||
@@ -60,6 +61,14 @@ struct ChatThemeBackgroundData;
|
||||
class MessageSendingAnimationController;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Ui::BotWebView {
|
||||
class Panel;
|
||||
} // namespace Ui::BotWebView
|
||||
|
||||
namespace InlineBots {
|
||||
struct ResultSelected;
|
||||
} // namespace InlineBots
|
||||
|
||||
namespace Data {
|
||||
struct CloudTheme;
|
||||
enum class CloudThemeType;
|
||||
@@ -195,9 +204,12 @@ public:
|
||||
FullMsgId clickFromMessageId;
|
||||
};
|
||||
void showPeerByLink(const PeerByLinkInfo &info);
|
||||
void showAttachWebview(
|
||||
|
||||
void resolveAttachWebview(
|
||||
not_null<PeerData*> peer,
|
||||
const QString &botUsername);
|
||||
[[nodiscard]] auto inlineResultConfirmed() const
|
||||
-> rpl::producer<InlineBots::ResultSelected>;
|
||||
|
||||
void showRepliesForMessage(
|
||||
not_null<History*> history,
|
||||
@@ -266,14 +278,34 @@ private:
|
||||
not_null<PeerData*> peer,
|
||||
const PeerByLinkInfo &info);
|
||||
|
||||
void requestAttachWebview(
|
||||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> bot);
|
||||
void requestAddToMenu(not_null<UserData*> bot, Fn<void()> callback);
|
||||
void showAttachWebview(
|
||||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> bot,
|
||||
uint64 queryId,
|
||||
const QString &url);
|
||||
|
||||
void toggleInMenu(
|
||||
not_null<UserData*> bot,
|
||||
bool enabled,
|
||||
Fn<void()> callback);
|
||||
|
||||
const not_null<Main::Session*> _session;
|
||||
|
||||
MTP::Sender _api;
|
||||
|
||||
mtpRequestId _resolveRequestId = 0;
|
||||
|
||||
History *_showingRepliesHistory = nullptr;
|
||||
MsgId _showingRepliesRootId = 0;
|
||||
mtpRequestId _showingRepliesRequestId = 0;
|
||||
|
||||
std::unique_ptr<Ui::BotWebView::Panel> _botWebView;
|
||||
rpl::event_stream<InlineBots::ResultSelected> _inlineResultConfirmed;
|
||||
|
||||
};
|
||||
|
||||
class SessionController : public SessionNavigation {
|
||||
|
Reference in New Issue
Block a user