fix: forum link

This commit is contained in:
AlexeyZavar 2025-02-14 04:45:09 +03:00
parent 25821ba338
commit 57aebdd300
2 changed files with 7 additions and 6 deletions

View file

@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
#include "window/window_controller.h"
#include "window/window_session_controller.h"
#include "window/window_session_controller_link_info.h"
@ -46,7 +47,7 @@ rpl::producer<TextWithEntities> Text() {
} // namespace
AboutBox::AboutBox(QWidget *parent, not_null<Window::SessionController*> controller)
AboutBox::AboutBox(QWidget *parent, Window::SessionController* controller)
: _version(this, tr::lng_about_version(tr::now, lt_version, currentVersionText()), st::aboutVersionLink)
, _text(this, Text(), st::aboutLabel)
, _controller(controller) {
@ -58,12 +59,12 @@ void AboutBox::prepare() {
addButton(tr::lng_close(), [this] { closeBox(); });
addLeftButton(
rpl::single(QString("@ayugramchat")),
[=]
[this, controller = _controller]
{
_controller->showPeerByLink(Window::PeerByLinkInfo{
closeBox();
controller->showPeerByLink(Window::PeerByLinkInfo{
.usernameOrId = QString("ayugramchat"),
});
closeBox();
});
_text->setLinksTrusted();

View file

@ -20,7 +20,7 @@ class FlatLabel;
class AboutBox : public Ui::BoxContent {
public:
AboutBox(QWidget*, not_null<Window::SessionController*> controller);
AboutBox(QWidget*, Window::SessionController* controller);
protected:
void prepare() override;
@ -33,7 +33,7 @@ private:
object_ptr<Ui::LinkButton> _version;
object_ptr<Ui::FlatLabel> _text;
not_null<Window::SessionController*> _controller;
Window::SessionController* _controller;
};