2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Auto-submit bot start in subscription settings.

This commit is contained in:
John Preston
2022-06-08 17:19:39 +04:00
parent 916f86b401
commit 17b2d043cb
3 changed files with 19 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/random.h"
#include "core/application.h"
#include "core/click_handler_types.h"
#include "data/data_peer_values.h"
#include "info/info_wrap_widget.h" // Info::Wrap.
#include "info/settings/info_settings_widget.h" // SectionCustomTopBarData.
@@ -926,6 +927,20 @@ QPointer<Ui::RpWidget> Premium::createPinnedToBottom(
button->resizeToWidth(width - padding.left() - padding.right());
}, status->lifetime());
const auto controller = _controller;
status->entity()->setClickHandlerFilter([=](
const ClickHandlerPtr &handler,
Qt::MouseButton button) {
ActivateClickHandler(status, handler, {
button,
QVariant::fromValue(ClickHandlerContext{
.sessionWindow = base::make_weak(controller.get()),
.botStartAutoSubmit = true,
})
});
return false;
});
const auto session = &_controller->session();
rpl::combine(
terms->heightValue(),