2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 07:05:13 +00:00

0.8.26.dev version with fixed schema

This commit is contained in:
John Preston
2015-06-17 00:01:43 +03:00
parent 5fadfed47a
commit 05ac97526e
23 changed files with 186 additions and 46 deletions

View File

@@ -748,7 +748,16 @@ void TextLink::onClick(Qt::MouseButton button) const {
QRegularExpressionMatch telegramMeGroup = QRegularExpression(qsl("^https?://telegram\\.me/joinchat/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url);
QRegularExpressionMatch telegramMeStickers = QRegularExpression(qsl("^https?://telegram\\.me/addstickers/([a-zA-Z0-9\\.\\_]+)(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url);
if (telegramMeUser.hasMatch()) {
App::openUserByName(telegramMeUser.captured(1));
QString params = url.mid(telegramMeUser.captured(0).size()), start, startToken;
if (!params.isEmpty()) {
QRegularExpressionMatch startParams = QRegularExpression(qsl("(^|&)(s|sg)=([a-zA-Z0-9\\.\\_\\-]+)(&|$)"), QRegularExpression::CaseInsensitiveOption).match(params);
if (startParams.hasMatch()) {
start = startParams.captured(2);
startToken = startParams.captured(3);
start = (start == qsl("sg") ? qsl("startgroup") : (start == qsl("s") ? qsl("start") : QString()));
}
}
App::openUserByName(telegramMeUser.captured(1), start == qsl("startgroup"), start, startToken);
} else if (telegramMeGroup.hasMatch()) {
App::joinGroupByHash(telegramMeGroup.captured(1));
} else if (telegramMeStickers.hasMatch()) {