mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
feat: pseudo support tg://ayu
This commit is contained in:
parent
7426d285b4
commit
e0c2294d50
3 changed files with 22 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -19,4 +19,9 @@ bool ResolveUser(
|
|||
const Match &match,
|
||||
const QVariant &context);
|
||||
|
||||
bool HandleAyu(
|
||||
Window::SessionController *controller,
|
||||
const Match &match,
|
||||
const QVariant &context);
|
||||
|
||||
}
|
|
@ -1003,6 +1003,10 @@ const std::vector<LocalUrlHandler> &LocalUrlHandlers() {
|
|||
u"^user\\?(.+)(#|$)"_q,
|
||||
AyuUrlHandlers::ResolveUser
|
||||
},
|
||||
{
|
||||
u"^ayu/?(.+)?(#|$)"_q,
|
||||
AyuUrlHandlers::HandleAyu
|
||||
},
|
||||
{
|
||||
u"^([^\\?]+)(\\?|#|$)"_q,
|
||||
HandleUnknown
|
||||
|
|
Loading…
Add table
Reference in a new issue