feat: pseudo support tg://ayu

This commit is contained in:
ZavaruKitsu 2024-01-03 20:46:36 +03:00
parent 7426d285b4
commit e0c2294d50
3 changed files with 22 additions and 0 deletions

View file

@ -9,6 +9,7 @@
#include "base/qthelp_url.h"
#include "lang_auto.h"
#include "mainwindow.h"
#include "ui/boxes/confirm_box.h"
#include "ayu/utils/telegram_helpers.h"
#include "boxes/abstract_box.h"
@ -54,4 +55,16 @@ bool ResolveUser(
return true;
}
bool HandleAyu(
Window::SessionController *controller,
const Match &match,
const QVariant &context)
{
if (!controller) {
return false;
}
controller->showToast(QString(":3"), 500);
return true;
}
}

View file

@ -19,4 +19,9 @@ bool ResolveUser(
const Match &match,
const QVariant &context);
bool HandleAyu(
Window::SessionController *controller,
const Match &match,
const QVariant &context);
}

View file

@ -1003,6 +1003,10 @@ const std::vector<LocalUrlHandler> &LocalUrlHandlers() {
u"^user\\?(.+)(#|$)"_q,
AyuUrlHandlers::ResolveUser
},
{
u"^ayu/?(.+)?(#|$)"_q,
AyuUrlHandlers::HandleAyu
},
{
u"^([^\\?]+)(\\?|#|$)"_q,
HandleUnknown