2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Provided more context for click handlers.

This commit is contained in:
23rd
2021-07-26 19:27:08 +03:00
parent 7c8b1cd5b1
commit 93bcd90fd4
10 changed files with 114 additions and 19 deletions

View File

@@ -23,11 +23,15 @@ class SessionController;
[[nodiscard]] bool UrlRequiresConfirmation(const QUrl &url);
class PeerData;
struct ClickHandlerContext {
FullMsgId itemId;
// Is filled from sections.
Fn<HistoryView::ElementDelegate*()> elementDelegate;
base::weak_ptr<Window::SessionController> sessionWindow;
bool skipBotAutoLogin = false;
// Is filled from peer info.
PeerData *peer = nullptr;
};
Q_DECLARE_METATYPE(ClickHandlerContext);
@@ -169,7 +173,6 @@ private:
};
class PeerData;
class BotCommandClickHandler : public TextClickHandler {
public:
BotCommandClickHandler(const QString &cmd) : _cmd(cmd) {