First Kotatogram version
73
README.md
|
|
@ -1,63 +1,26 @@
|
|||
# [Telegram Desktop][telegram_desktop] – Official Messenger
|
||||
# Kotatogram – experimental [Telegram Desktop][telegram_desktop] fork.
|
||||
|
||||
This is the complete source code and the build instructions for the alpha version of the official desktop client for the [Telegram][telegram] messenger, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol.
|
||||
Original README with build instructions and licenses could be found in [Telegram Desktop repository][telegram_desktop_readme].
|
||||
|
||||
[](https://github.com/telegramdesktop/tdesktop/releases)
|
||||
[](https://travis-ci.org/telegramdesktop/tdesktop)
|
||||
[](https://ci.appveyor.com/project/telegramdesktop/tdesktop)
|
||||
There will be builds of Kotatogram for Windows, and possibly Linux. No autoupdates for now.
|
||||
|
||||
[![Preview of Telegram Desktop][preview_image]][preview_image_url]
|
||||
Expect a lot of breaking changes.
|
||||
|
||||
The source code is published under GPLv3 with OpenSSL exception, the license is available [here][license].
|
||||
## Changes
|
||||
|
||||
## Supported systems
|
||||
|
||||
* Windows XP - Windows 10 (**not** RT)
|
||||
* Mac OS X 10.8 - Mac OS X 10.11
|
||||
* Mac OS X 10.6 - Mac OS X 10.7 (separate build)
|
||||
* Ubuntu 12.04 - Ubuntu 19.04
|
||||
* Fedora 22 - Fedora 30
|
||||
* [Snappy](https://snapcraft.io/telegram-desktop)
|
||||
* [Flathub](https://flathub.org/apps/details/org.telegram.desktop)
|
||||
|
||||
## Third-party
|
||||
|
||||
* Qt 5.3.2 and 5.6.2, slightly patched ([LGPL](http://doc.qt.io/qt-5/lgpl.html))
|
||||
* OpenSSL 1.0.1g ([OpenSSL License](https://www.openssl.org/source/license.html))
|
||||
* zlib 1.2.8 ([zlib License](http://www.zlib.net/zlib_license.html))
|
||||
* libexif 0.6.20 ([LGPL](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html))
|
||||
* LZMA SDK 9.20 ([public domain](http://www.7-zip.org/sdk.html))
|
||||
* liblzma ([public domain](http://tukaani.org/xz/))
|
||||
* Google Breakpad ([License](https://chromium.googlesource.com/breakpad/breakpad/+/master/LICENSE))
|
||||
* Google Crashpad ([Apache License 2.0](https://chromium.googlesource.com/crashpad/crashpad/+/master/LICENSE))
|
||||
* GYP ([BSD License](https://github.com/bnoordhuis/gyp/blob/master/LICENSE))
|
||||
* Ninja ([Apache License 2.0](https://github.com/ninja-build/ninja/blob/master/COPYING))
|
||||
* OpenAL Soft ([LGPL](https://github.com/kcat/openal-soft/blob/master/COPYING))
|
||||
* Opus codec ([BSD License](http://www.opus-codec.org/license/))
|
||||
* FFmpeg ([LGPL](https://www.ffmpeg.org/legal.html))
|
||||
* Guideline Support Library ([MIT License](https://github.com/Microsoft/GSL/blob/master/LICENSE))
|
||||
* Mapbox Variant ([BSD License](https://github.com/mapbox/variant/blob/master/LICENSE))
|
||||
* Range-v3 ([Boost License](https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt))
|
||||
* Open Sans font ([Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html))
|
||||
* Emoji alpha codes ([MIT License](https://github.com/emojione/emojione/blob/master/extras/alpha-codes/LICENSE.md))
|
||||
* Catch test framework ([Boost License](https://github.com/philsquared/Catch/blob/master/LICENSE.txt))
|
||||
* xxHash ([BSD License](https://github.com/Cyan4973/xxHash/blob/dev/LICENSE))
|
||||
|
||||
## Build instructions
|
||||
|
||||
* [Visual Studio 2019][msvc]
|
||||
* [Xcode 10][xcode]
|
||||
* [GYP/CMake on GNU/Linux][cmake]
|
||||
* Mention user by name, even if username was set (right mouse click on mention suggestion).
|
||||
* Clickable links in user bios.
|
||||
* Custom font start options:
|
||||
* `-mainfont` to set main font family (e.g. `-mainfont "Open Sans"`).
|
||||
* `-semiboldfont` to set semibold font family (`-semiboldfont "Open Sans Semibold"`).
|
||||
* `-semiboldisbold` - if you want set semibold font to be bold. If you pass `Open Sans Bold` to `-semiboldfont`, that won't work. You should use family name (e.g. `-semiboldfont "Open Sans" -semiboldisbold`)
|
||||
* `-monospacefont` to set monospaced font (e.g. `-monospacefont "Consolas"`)
|
||||
* You can set "Nobody" in profile photo privacy.
|
||||
* Minimum photo size in chat has been increased to 200px, so captions should be more readable.
|
||||
* Maximum sticker size in chat has been decreased to 128px.
|
||||
* Maximum caption field height has been increased to 150px (should fit about 5 lines).
|
||||
* Allow interface scales `75-99` to be saved after restarting without start option.
|
||||
|
||||
[//]: # (LINKS)
|
||||
[telegram]: https://telegram.org
|
||||
[telegram_desktop]: https://desktop.telegram.org
|
||||
[telegram_api]: https://core.telegram.org
|
||||
[telegram_proto]: https://core.telegram.org/mtproto
|
||||
[license]: LICENSE
|
||||
[msvc]: docs/building-msvc.md
|
||||
[xcode]: docs/building-xcode.md
|
||||
[xcode_old]: docs/building-xcode-old.md
|
||||
[cmake]: docs/building-cmake.md
|
||||
[preview_image]: https://github.com/telegramdesktop/tdesktop/blob/dev/docs/assets/preview.png "Preview of Telegram Desktop"
|
||||
[preview_image_url]: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/docs/assets/preview.png
|
||||
[telegram_desktop_readme]: https://github.com/telegramdesktop/tdesktop/blob/dev/README.md
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 361 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 15 KiB |
|
|
@ -223,6 +223,9 @@ namespace App {
|
|||
void initMedia() {
|
||||
if (!::monofont) {
|
||||
QString family;
|
||||
if (!cMonospaceFont().isEmpty()) {
|
||||
tryFontFamily(family, cMonospaceFont());
|
||||
}
|
||||
tryFontFamily(family, qsl("Consolas"));
|
||||
tryFontFamily(family, qsl("Liberation Mono"));
|
||||
tryFontFamily(family, qsl("Menlo"));
|
||||
|
|
|
|||
|
|
@ -27,11 +27,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
namespace {
|
||||
|
||||
rpl::producer<TextWithEntities> Text1() {
|
||||
return tr::lng_about_text1(
|
||||
lt_api_link,
|
||||
tr::lng_about_text1_api(
|
||||
) | Ui::Text::ToLink("https://core.telegram.org/api"),
|
||||
Ui::Text::WithEntities);
|
||||
return rpl::single(
|
||||
qsl("Unofficial experimental fork of ") +
|
||||
Ui::Text::Link(
|
||||
"Telegram Desktop",
|
||||
"https://github.com/telegramdesktop/tdesktop") +
|
||||
qsl("."));
|
||||
}
|
||||
|
||||
rpl::producer<TextWithEntities> Text2() {
|
||||
|
|
@ -39,19 +40,25 @@ rpl::producer<TextWithEntities> Text2() {
|
|||
lt_gpl_link,
|
||||
rpl::single(Ui::Text::Link(
|
||||
"GNU GPL",
|
||||
"https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE")),
|
||||
"https://github.com/kotatogram/kotatogram-desktop/blob/master/LICENSE")),
|
||||
lt_github_link,
|
||||
rpl::single(Ui::Text::Link(
|
||||
"GitHub",
|
||||
"https://github.com/telegramdesktop/tdesktop")),
|
||||
"https://github.com/kotatogram/kotatogram-desktop")),
|
||||
Ui::Text::WithEntities);
|
||||
}
|
||||
|
||||
rpl::producer<TextWithEntities> Text3() {
|
||||
return tr::lng_about_text3(
|
||||
lt_faq_link,
|
||||
tr::lng_about_text3_faq() | Ui::Text::ToLink(telegramFaqLink()),
|
||||
Ui::Text::WithEntities);
|
||||
return rpl::single(
|
||||
qsl("Visit ") +
|
||||
Ui::Text::Link(
|
||||
"Telegram FAQ",
|
||||
telegramFaqLink()) +
|
||||
qsl(" or ") +
|
||||
Ui::Text::Link(
|
||||
"Kotatogram channel",
|
||||
telegramFaqLink()) +
|
||||
qsl(" for more info."));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
@ -64,7 +71,7 @@ AboutBox::AboutBox(QWidget *parent)
|
|||
}
|
||||
|
||||
void AboutBox::prepare() {
|
||||
setTitle(rpl::single(qsl("Telegram Desktop")));
|
||||
setTitle(rpl::single(qsl("Kotatogram Desktop")));
|
||||
|
||||
addButton(tr::lng_close(), [this] { closeBox(); });
|
||||
|
||||
|
|
|
|||
|
|
@ -563,7 +563,7 @@ autoDownloadLimitPadding: margins(22px, 8px, 22px, 8px);
|
|||
|
||||
confirmCaptionArea: InputField(defaultInputField) {
|
||||
textMargins: margins(1px, 26px, 31px, 4px);
|
||||
heightMax: 78px;
|
||||
heightMax: 150px;
|
||||
}
|
||||
confirmBg: windowBgOver;
|
||||
confirmMaxHeight: 245px;
|
||||
|
|
|
|||
|
|
@ -879,7 +879,7 @@ void FieldAutocompleteInner::setRecentInlineBotsInRows(int32 bots) {
|
|||
|
||||
void FieldAutocompleteInner::mousePressEvent(QMouseEvent *e) {
|
||||
selectByMouse(e->globalPos());
|
||||
if (e->button() == Qt::LeftButton) {
|
||||
if (e->button() == Qt::LeftButton || e->button() == Qt::RightButton) {
|
||||
if (_overDelete && _sel >= 0 && _sel < (_mrows->isEmpty() ? _hrows->size() : _recentInlineBotsInRows)) {
|
||||
bool removed = false;
|
||||
if (_mrows->isEmpty()) {
|
||||
|
|
@ -909,7 +909,11 @@ void FieldAutocompleteInner::mousePressEvent(QMouseEvent *e) {
|
|||
|
||||
selectByMouse(e->globalPos());
|
||||
} else if (_srows->empty()) {
|
||||
chooseSelected(FieldAutocomplete::ChooseMethod::ByClick);
|
||||
if (e->button() == Qt::LeftButton) {
|
||||
chooseSelected(FieldAutocomplete::ChooseMethod::ByClick);
|
||||
} else if (e->button() == Qt::RightButton) {
|
||||
chooseSelected(FieldAutocomplete::ChooseMethod::ByRightClick);
|
||||
}
|
||||
} else {
|
||||
_down = _sel;
|
||||
_previewTimer.callOnce(QApplication::startDragTime());
|
||||
|
|
@ -932,7 +936,11 @@ void FieldAutocompleteInner::mouseReleaseEvent(QMouseEvent *e) {
|
|||
|
||||
if (_sel < 0 || _sel != pressed || _srows->empty()) return;
|
||||
|
||||
chooseSelected(FieldAutocomplete::ChooseMethod::ByClick);
|
||||
if (e->button() == Qt::LeftButton) {
|
||||
chooseSelected(FieldAutocomplete::ChooseMethod::ByClick);
|
||||
} else if (e->button() == Qt::RightButton) {
|
||||
chooseSelected(FieldAutocomplete::ChooseMethod::ByRightClick);
|
||||
}
|
||||
}
|
||||
|
||||
void FieldAutocompleteInner::enterEventHook(QEvent *e) {
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ public:
|
|||
ByEnter,
|
||||
ByTab,
|
||||
ByClick,
|
||||
ByRightClick,
|
||||
};
|
||||
bool chooseSelected(ChooseMethod method) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "settings.h"
|
||||
|
||||
constexpr str_const AppNameOld = "Telegram Win (Unofficial)";
|
||||
constexpr str_const AppName = "Telegram Desktop";
|
||||
constexpr str_const AppName = "Kotatogram Desktop";
|
||||
|
||||
constexpr str_const AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"; // used in updater.cpp and Setup.iss for Windows
|
||||
constexpr str_const AppFile = "Telegram";
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ NotStartedWindow::NotStartedWindow()
|
|||
: _label(this)
|
||||
, _log(this)
|
||||
, _close(this) {
|
||||
_label.setText(qsl("Could not start Telegram Desktop!\nYou can see complete log below:"));
|
||||
_label.setText(qsl("Could not start Kotatogram Desktop!\nYou can see complete log below:"));
|
||||
|
||||
_log.setPlainText(Logs::full());
|
||||
|
||||
|
|
@ -303,9 +303,9 @@ LastCrashedWindow::LastCrashedWindow(
|
|||
connect(&_networkSettings, SIGNAL(clicked()), this, SLOT(onNetworkSettings()));
|
||||
|
||||
if (_sendingState == SendingNoReport) {
|
||||
_label.setText(qsl("Last time Telegram Desktop was not closed properly."));
|
||||
_label.setText(qsl("Last time Kotatogram Desktop was not closed properly."));
|
||||
} else {
|
||||
_label.setText(qsl("Last time Telegram Desktop crashed :("));
|
||||
_label.setText(qsl("Last time Kotatogram Desktop crashed :("));
|
||||
}
|
||||
|
||||
if (_updaterData) {
|
||||
|
|
@ -364,7 +364,7 @@ LastCrashedWindow::LastCrashedWindow(
|
|||
connect(&_showReport, SIGNAL(clicked()), this, SLOT(onViewReport()));
|
||||
_saveReport.setText(qsl("SAVE TO FILE"));
|
||||
connect(&_saveReport, SIGNAL(clicked()), this, SLOT(onSaveReport()));
|
||||
_getApp.setText(qsl("GET THE LATEST OFFICIAL VERSION OF TELEGRAM DESKTOP"));
|
||||
_getApp.setText(qsl("GET THE LATEST VERSION OF KOTATOGRAM DESKTOP"));
|
||||
connect(&_getApp, SIGNAL(clicked()), this, SLOT(onGetApp()));
|
||||
|
||||
_send.setText(qsl("SEND CRASH REPORT"));
|
||||
|
|
@ -496,12 +496,12 @@ void LastCrashedWindow::onCheckingFinished() {
|
|||
LOG(("Crash report check for sending done, result: %1").arg(QString::fromUtf8(result)));
|
||||
|
||||
if (result == "Old") {
|
||||
_pleaseSendReport.setText(qsl("This report is about some old version of Telegram Desktop."));
|
||||
_pleaseSendReport.setText(qsl("This report is about some old version of Kotatogram Desktop."));
|
||||
_sendingState = SendingTooOld;
|
||||
updateControls();
|
||||
return;
|
||||
} else if (result == "Unofficial") {
|
||||
_pleaseSendReport.setText(qsl("You use some custom version of Telegram Desktop."));
|
||||
_pleaseSendReport.setText(qsl("You use some custom version of Kotatogram Desktop."));
|
||||
_sendingState = SendingUnofficial;
|
||||
updateControls();
|
||||
return;
|
||||
|
|
@ -781,7 +781,7 @@ void LastCrashedWindow::updateControls() {
|
|||
}
|
||||
|
||||
QRect scr(QApplication::primaryScreen()->availableGeometry());
|
||||
QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h);
|
||||
QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time Kotatogram Desktop was not closed properly.")) + padding + _networkSettings.width(), h);
|
||||
if (s == size()) {
|
||||
resizeEvent(0);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ StartResult Start() {
|
|||
fclose(f);
|
||||
|
||||
LOG(("Opened '%1' for reading, the previous "
|
||||
"Telegram Desktop launch was not finished properly :( "
|
||||
"Kotatogram Desktop launch was not finished properly :( "
|
||||
"Crash log size: %2").arg(ReportPath).arg(lastdump.size()));
|
||||
|
||||
return lastdump;
|
||||
|
|
|
|||
|
|
@ -391,6 +391,10 @@ void Launcher::processArguments() {
|
|||
{ "-workdir" , KeyFormat::OneValue },
|
||||
{ "--" , KeyFormat::OneValue },
|
||||
{ "-scale" , KeyFormat::OneValue },
|
||||
{ "-mainfont" , KeyFormat::OneValue },
|
||||
{ "-semiboldfont" , KeyFormat::OneValue },
|
||||
{ "-semiboldisbold" , KeyFormat::NoValues },
|
||||
{ "-monospacefont" , KeyFormat::OneValue },
|
||||
};
|
||||
auto parseResult = QMap<QByteArray, QStringList>();
|
||||
auto parsingKey = QByteArray();
|
||||
|
|
@ -448,6 +452,11 @@ void Launcher::processArguments() {
|
|||
? kInterfaceScaleAuto
|
||||
: value;
|
||||
}
|
||||
|
||||
gMainFont = parseResult.value("-mainfont", {}).join(QString());
|
||||
gSemiboldFont = parseResult.value("-semiboldfont", {}).join(QString());
|
||||
gSemiboldFontIsBold = parseResult.contains("-semiboldisbold");
|
||||
gMonospaceFont = parseResult.value("-monospacefont", {}).join(QString());
|
||||
}
|
||||
|
||||
int Launcher::executeApplication() {
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ void Manager::writeDefaultFile() {
|
|||
return;
|
||||
}
|
||||
const char *defaultHeader = R"HEADER(
|
||||
// This is a list of default shortcuts for Telegram Desktop
|
||||
// This is a list of default shortcuts for Kotatogram Desktop
|
||||
// Please don't modify it, its content is not used in any way
|
||||
// You can place your own shortcuts in the 'shortcuts-custom.json' file
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#endif // TDESKTOP_OFFICIAL_TARGET
|
||||
|
||||
constexpr auto AppVersion = 1008008;
|
||||
constexpr auto AppVersionStr = "1.8.8";
|
||||
constexpr auto AppVersionStr = "1.8.8-KTG1";
|
||||
constexpr auto AppBetaVersion = false;
|
||||
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
|
||||
|
|
|
|||
|
|
@ -169,8 +169,8 @@ Stats AbstractWriter::produceTestExample(
|
|||
|
||||
auto sessions = Data::SessionsList();
|
||||
auto session = Data::Session();
|
||||
session.applicationName = "Telegram Desktop";
|
||||
session.applicationVersion = "1.3.8";
|
||||
session.applicationName = "Kotatogram Desktop";
|
||||
session.applicationVersion = "1.8.8";
|
||||
session.country = "GB";
|
||||
session.created = date();
|
||||
session.deviceModel = "PC";
|
||||
|
|
|
|||
|
|
@ -977,7 +977,7 @@ auto HtmlWriter::Wrap::pushMessage(
|
|||
dialog,
|
||||
basePath,
|
||||
"This message is not supported by this version "
|
||||
"of Telegram Desktop. Please update the application.") };
|
||||
"of Kotatogram Desktop. Please update the application.") };
|
||||
}
|
||||
|
||||
const auto wrapReplyToLink = [&](const QByteArray &text) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ QByteArray SerializeMessage(
|
|||
|
||||
if (message.media.content.is<UnsupportedMedia>()) {
|
||||
return "Error! This message is not supported "
|
||||
"by this version of Telegram Desktop. "
|
||||
"by this version of Kotatogram Desktop. "
|
||||
"Please update the application.";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ void SettingsWidget::addLocationLabel(
|
|||
}) | rpl::distinct_until_changed(
|
||||
) | rpl::map([](const QString &path) {
|
||||
const auto text = IsDefaultPath(path)
|
||||
? QString("Downloads/Telegram Desktop")
|
||||
? QString("Downloads/Kotatogram Desktop")
|
||||
: path;
|
||||
return Ui::Text::Link(
|
||||
QDir::toNativeSeparators(text),
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ using "basic.style";
|
|||
using "dialogs/dialogs.style";
|
||||
using "ui/widgets/widgets.style";
|
||||
|
||||
minPhotoSize: 100px;
|
||||
minPhotoSize: 200px;
|
||||
minVideoSize: 160px;
|
||||
maxMediaSize: 430px;
|
||||
maxStickerSize: 256px;
|
||||
maxStickerSize: 128px;
|
||||
maxGifSize: 320px;
|
||||
maxVideoMessageSize: 240px;
|
||||
maxSignatureSize: 144px;
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ HistoryWidget::HistoryWidget(
|
|||
|
||||
InitMessageField(controller, _field);
|
||||
_fieldAutocomplete->hide();
|
||||
connect(_fieldAutocomplete, SIGNAL(mentionChosen(UserData*,FieldAutocomplete::ChooseMethod)), this, SLOT(onMentionInsert(UserData*)));
|
||||
connect(_fieldAutocomplete, SIGNAL(mentionChosen(UserData*,FieldAutocomplete::ChooseMethod)), this, SLOT(onMentionInsert(UserData*,FieldAutocomplete::ChooseMethod)));
|
||||
connect(_fieldAutocomplete, SIGNAL(hashtagChosen(QString,FieldAutocomplete::ChooseMethod)), this, SLOT(onHashtagOrBotCommandInsert(QString,FieldAutocomplete::ChooseMethod)));
|
||||
connect(_fieldAutocomplete, SIGNAL(botCommandChosen(QString,FieldAutocomplete::ChooseMethod)), this, SLOT(onHashtagOrBotCommandInsert(QString,FieldAutocomplete::ChooseMethod)));
|
||||
connect(_fieldAutocomplete, &FieldAutocomplete::stickerChosen, this, [=](not_null<DocumentData*> document) {
|
||||
|
|
@ -992,9 +992,9 @@ void HistoryWidget::start() {
|
|||
});
|
||||
}
|
||||
|
||||
void HistoryWidget::onMentionInsert(UserData *user) {
|
||||
void HistoryWidget::onMentionInsert(UserData *user, FieldAutocomplete::ChooseMethod method) {
|
||||
QString replacement, entityTag;
|
||||
if (user->username.isEmpty()) {
|
||||
if (method == FieldAutocomplete::ChooseMethod::ByRightClick || user->username.isEmpty()) {
|
||||
replacement = user->firstName;
|
||||
if (replacement.isEmpty()) {
|
||||
replacement = App::peerName(user);
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
if (user->isBot()) {
|
||||
addInfoLine(tr::lng_info_about_label(), AboutValue(user));
|
||||
} else {
|
||||
addInfoLine(tr::lng_info_bio_label(), BioValue(user));
|
||||
addInfoLine(tr::lng_info_bio_label(), AboutValue(user));
|
||||
}
|
||||
addInfoOneLine(
|
||||
tr::lng_info_username_label(),
|
||||
|
|
|
|||
|
|
@ -97,11 +97,11 @@ rpl::producer<TextWithEntities> UsernameValue(not_null<UserData*> user) {
|
|||
}
|
||||
|
||||
rpl::producer<QString> PlainAboutValue(not_null<PeerData*> peer) {
|
||||
if (const auto user = peer->asUser()) {
|
||||
/*if (const auto user = peer->asUser()) {
|
||||
if (!user->isBot()) {
|
||||
return rpl::single(QString());
|
||||
}
|
||||
}
|
||||
}*/
|
||||
return Notify::PeerUpdateValue(
|
||||
peer,
|
||||
Notify::PeerUpdate::Flag::AboutChanged
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ StartWidget::StartWidget(
|
|||
not_null<Widget::Data*> data)
|
||||
: Step(parent, account, data, true) {
|
||||
setMouseTracking(true);
|
||||
setTitleText(rpl::single(qsl("Telegram Desktop")));
|
||||
setTitleText(rpl::single(qsl("Kotatogram Desktop")));
|
||||
setDescriptionText(tr::lng_intro_about());
|
||||
show();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2983,7 +2983,7 @@ void MainWidget::gotDifference(const MTPupdates_Difference &difference) {
|
|||
} break;
|
||||
case mtpc_updates_differenceTooLong: {
|
||||
auto &d = difference.c_updates_differenceTooLong();
|
||||
LOG(("API Error: updates.differenceTooLong is not supported by Telegram Desktop!"));
|
||||
LOG(("API Error: updates.differenceTooLong is not supported by Kotatogram Desktop!"));
|
||||
} break;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ SpecialConfigRequest::SpecialConfigRequest(
|
|||
|
||||
_manager.setProxy(QNetworkProxy::NoProxy);
|
||||
_attempts = {
|
||||
//{ Type::App, qsl("software-download.microsoft.com") },
|
||||
{ Type::App, qsl("software-download.microsoft.com") },
|
||||
};
|
||||
for (const auto &domain : DnsDomains()) {
|
||||
_attempts.push_back({ Type::Dns, domain });
|
||||
|
|
@ -316,12 +316,12 @@ void SpecialConfigRequest::performRequest(const Attempt &attempt) {
|
|||
url.setHost(attempt.domain);
|
||||
auto request = QNetworkRequest();
|
||||
switch (type) {
|
||||
//case Type::App: {
|
||||
// url.setPath(cTestMode()
|
||||
// ? qsl("/testv2/config.txt")
|
||||
// : qsl("/prodv2/config.txt"));
|
||||
// request.setRawHeader("Host", "tcdnb.azureedge.net");
|
||||
//} break;
|
||||
case Type::App: {
|
||||
url.setPath(cTestMode()
|
||||
? qsl("/testv2/config.txt")
|
||||
: qsl("/prodv2/config.txt"));
|
||||
request.setRawHeader("Host", "tcdnb.azureedge.net");
|
||||
} break;
|
||||
case Type::Dns: {
|
||||
url.setPath(qsl("/resolve"));
|
||||
url.setQuery(qsl("name=%1&type=ANY&random_padding=%2"
|
||||
|
|
@ -379,7 +379,7 @@ void SpecialConfigRequest::requestFinished(
|
|||
}
|
||||
|
||||
switch (type) {
|
||||
//case Type::App: handleResponse(result); break;
|
||||
case Type::App: handleResponse(result); break;
|
||||
case Type::Dns: {
|
||||
constexpr auto kTypeRestriction = 16; // TXT
|
||||
handleResponse(ConcatenateDnsTxtFields(
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
private:
|
||||
enum class Type {
|
||||
//App,
|
||||
App,
|
||||
Dns,
|
||||
};
|
||||
struct Attempt {
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ void MainWindow::psCreateTrayIcon() {
|
|||
QFileInfo iconFile(_trayIconImageFile());
|
||||
if (iconFile.exists()) {
|
||||
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath());
|
||||
_trayIndicator = Libs::app_indicator_new("Telegram Desktop", path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
|
||||
_trayIndicator = Libs::app_indicator_new("Kotatogram Desktop", path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
|
||||
if (_trayIndicator) {
|
||||
LOG(("Tray Icon: Using appindicator tray icon."));
|
||||
} else {
|
||||
|
|
@ -515,8 +515,8 @@ void MainWindow::psCreateTrayIcon() {
|
|||
Libs::g_signal_connect_helper(_trayIcon, "activate", GCallback(_trayIconActivate), _trayMenu);
|
||||
Libs::g_signal_connect_helper(_trayIcon, "size-changed", GCallback(_trayIconResized), _trayMenu);
|
||||
|
||||
Libs::gtk_status_icon_set_title(_trayIcon, "Telegram Desktop");
|
||||
Libs::gtk_status_icon_set_tooltip_text(_trayIcon, "Telegram Desktop");
|
||||
Libs::gtk_status_icon_set_title(_trayIcon, "Kotatogram Desktop");
|
||||
Libs::gtk_status_icon_set_tooltip_text(_trayIcon, "Kotatogram Desktop");
|
||||
Libs::gtk_status_icon_set_visible(_trayIcon, true);
|
||||
} else {
|
||||
useStatusIcon = false;
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ QString GetServerName() {
|
|||
if (!LibNotifyLoaded()) {
|
||||
return QString();
|
||||
}
|
||||
if (!Libs::notify_is_initted() && !Libs::notify_init("Telegram Desktop")) {
|
||||
if (!Libs::notify_is_initted() && !Libs::notify_init("Kotatogram Desktop")) {
|
||||
LOG(("LibNotify Error: failed to init!"));
|
||||
return QString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ void RegisterCustomScheme() {
|
|||
if (!QDir(apps).exists()) QDir().mkpath(apps);
|
||||
if (!QDir(icons).exists()) QDir().mkpath(icons);
|
||||
|
||||
QString path = cWorkingDir() + qsl("tdata/"), file = path + qsl("telegramdesktop.desktop");
|
||||
QString path = cWorkingDir() + qsl("tdata/"), file = path + qsl("kotatogramdesktop.desktop");
|
||||
QDir().mkpath(path);
|
||||
QFile f(file);
|
||||
if (f.open(QIODevice::WriteOnly)) {
|
||||
|
|
@ -303,17 +303,17 @@ void RegisterCustomScheme() {
|
|||
s.setCodec("UTF-8");
|
||||
s << "[Desktop Entry]\n";
|
||||
s << "Version=1.0\n";
|
||||
s << "Name=Telegram Desktop\n";
|
||||
s << "Comment=Official desktop application for the Telegram messaging service\n";
|
||||
s << "Name=Kotatogram Desktop\n";
|
||||
s << "Comment=Experimental Telegram Desktop fork\n";
|
||||
s << "TryExec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << "\n";
|
||||
s << "Exec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << " -- %u\n";
|
||||
s << "Icon=telegram\n";
|
||||
s << "Terminal=false\n";
|
||||
s << "StartupWMClass=TelegramDesktop\n";
|
||||
s << "StartupWMClass=KotatogramDesktop\n";
|
||||
s << "Type=Application\n";
|
||||
s << "Categories=Network;InstantMessaging;Qt;\n";
|
||||
s << "MimeType=x-scheme-handler/tg;\n";
|
||||
s << "Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;\n";
|
||||
s << "Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;kotatogram;\n";
|
||||
s << "X-GNOME-UsesNotifications=true\n";
|
||||
f.close();
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ void RegisterCustomScheme() {
|
|||
QFile(qsl("%1.local/share/applications/telegram.desktop").arg(home)).remove();
|
||||
|
||||
RunShellCommand("update-desktop-database " + EscapeShell(QFile::encodeName(home + qsl(".local/share/applications"))));
|
||||
RunShellCommand("xdg-mime default telegramdesktop.desktop x-scheme-handler/tg");
|
||||
RunShellCommand("xdg-mime default kotatogramdesktop.desktop x-scheme-handler/tg");
|
||||
}
|
||||
} else {
|
||||
LOG(("App Error: Could not open '%1' for write").arg(file));
|
||||
|
|
|
|||
|
|
@ -429,24 +429,24 @@ void RegisterCustomScheme() {
|
|||
if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return;
|
||||
|
||||
// URI scheme registration as Default Program - Windows Vista and above
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\tdesktop.tg", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\tdesktop.tg\\DefaultIcon", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg\\DefaultIcon", &rkey)) return;
|
||||
if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl(",1\""))) return;
|
||||
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\tdesktop.tg\\shell", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\tdesktop.tg\\shell\\open", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\tdesktop.tg\\shell\\open\\command", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg\\shell", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg\\shell\\open", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg\\shell\\open\\command", &rkey)) return;
|
||||
if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return;
|
||||
|
||||
if (!_psOpenRegKey(L"Software\\TelegramDesktop", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\TelegramDesktop\\Capabilities", &rkey)) return;
|
||||
if (!_psSetKeyValue(rkey, L"ApplicationName", qsl("Telegram Desktop"))) return;
|
||||
if (!_psSetKeyValue(rkey, L"ApplicationDescription", qsl("Telegram Desktop"))) return;
|
||||
if (!_psOpenRegKey(L"Software\\TelegramDesktop\\Capabilities\\UrlAssociations", &rkey)) return;
|
||||
if (!_psSetKeyValue(rkey, L"tg", qsl("tdesktop.tg"))) return;
|
||||
if (!_psOpenRegKey(L"Software\\KotatogramDesktop", &rkey)) return;
|
||||
if (!_psOpenRegKey(L"Software\\KotatogramDesktop\\Capabilities", &rkey)) return;
|
||||
if (!_psSetKeyValue(rkey, L"ApplicationName", qsl("Kotatogram Desktop"))) return;
|
||||
if (!_psSetKeyValue(rkey, L"ApplicationDescription", qsl("Kotatogram Desktop"))) return;
|
||||
if (!_psOpenRegKey(L"Software\\KotatogramDesktop\\Capabilities\\UrlAssociations", &rkey)) return;
|
||||
if (!_psSetKeyValue(rkey, L"tg", qsl("ktgdesktop.tg"))) return;
|
||||
|
||||
if (!_psOpenRegKey(L"Software\\RegisteredApplications", &rkey)) return;
|
||||
if (!_psSetKeyValue(rkey, L"Telegram Desktop", qsl("SOFTWARE\\TelegramDesktop\\Capabilities"))) return;
|
||||
if (!_psSetKeyValue(rkey, L"Kotatogram Desktop", qsl("SOFTWARE\\KotatogramDesktop\\Capabilities"))) return;
|
||||
#endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -256,10 +256,10 @@ bool validateShortcut() {
|
|||
path += qsl("TelegramAlpha.lnk");
|
||||
if (validateShortcutAt(path)) return true;
|
||||
} else {
|
||||
if (validateShortcutAt(path + qsl("Telegram Desktop/Telegram.lnk"))) return true;
|
||||
if (validateShortcutAt(path + qsl("Telegram Win (Unofficial)/Telegram.lnk"))) return true;
|
||||
if (validateShortcutAt(path + qsl("Kotatogram Desktop/Telegram.lnk"))) return true;
|
||||
//if (validateShortcutAt(path + qsl("Telegram Win (Unofficial)/Telegram.lnk"))) return true;
|
||||
|
||||
path += qsl("Telegram.lnk");
|
||||
path += qsl("Kotatogram.lnk");
|
||||
if (validateShortcutAt(path)) return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,3 +72,6 @@ int gOtherOnline = 0;
|
|||
int32 gAutoDownloadPhoto = 0; // all auto download
|
||||
int32 gAutoDownloadAudio = 0;
|
||||
int32 gAutoDownloadGif = 0;
|
||||
|
||||
QString gMainFont, gSemiboldFont, gMonospaceFont;
|
||||
bool gSemiboldFontIsBold = false;
|
||||
|
|
@ -160,7 +160,7 @@ DeclareSetting(int32, IntRetinaFactor);
|
|||
DeclareSetting(int, OtherOnline);
|
||||
|
||||
constexpr auto kInterfaceScaleAuto = 0;
|
||||
constexpr auto kInterfaceScaleMin = 100;
|
||||
constexpr auto kInterfaceScaleMin = 75;
|
||||
constexpr auto kInterfaceScaleDefault = 100;
|
||||
constexpr auto kInterfaceScaleMax = 300;
|
||||
|
||||
|
|
@ -194,3 +194,8 @@ inline void SetScaleChecked(int scale) {
|
|||
: snap(scale, kInterfaceScaleMin, kInterfaceScaleMax / cIntRetinaFactor());
|
||||
cSetConfigScale(checked);
|
||||
}
|
||||
|
||||
DeclareSetting(QString, MainFont);
|
||||
DeclareSetting(QString, SemiboldFont);
|
||||
DeclareSetting(bool, SemiboldFontIsBold);
|
||||
DeclareSetting(QString, MonospaceFont);
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ void NotificationsCount::prepareNotificationSampleLarge() {
|
|||
p.setPen(st::dialogsNameFg);
|
||||
p.setFont(st::msgNameFont);
|
||||
|
||||
auto notifyTitle = st::msgNameFont->elided(qsl("Telegram Desktop"), rectForName.width());
|
||||
auto notifyTitle = st::msgNameFont->elided(qsl("Kotatogram Desktop"), rectForName.width());
|
||||
p.drawText(rectForName.left(), rectForName.top() + st::msgNameFont->ascent, notifyTitle);
|
||||
|
||||
st::notifyClose.icon.paint(p, w - st::notifyClosePos.x() - st::notifyClose.width + st::notifyClose.iconPosition.x(), st::notifyClosePos.y() + st::notifyClose.iconPosition.y(), w);
|
||||
|
|
|
|||
|
|
@ -891,9 +891,9 @@ rpl::producer<QString> ProfilePhotoPrivacyController::title() {
|
|||
return tr::lng_edit_privacy_profile_photo_title();
|
||||
}
|
||||
|
||||
bool ProfilePhotoPrivacyController::hasOption(Option option) {
|
||||
/*bool ProfilePhotoPrivacyController::hasOption(Option option) {
|
||||
return (option != Option::Nobody);
|
||||
}
|
||||
}*/
|
||||
|
||||
rpl::producer<QString> ProfilePhotoPrivacyController::optionsTitleKey() {
|
||||
return tr::lng_edit_privacy_profile_photo_header();
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ public:
|
|||
MTPInputPrivacyKey apiKey() override;
|
||||
|
||||
rpl::producer<QString> title() override;
|
||||
bool hasOption(Option option) override;
|
||||
//bool hasOption(Option option) override;
|
||||
rpl::producer<QString> optionsTitleKey() override;
|
||||
rpl::producer<QString> exceptionButtonTextKey(
|
||||
Exception exception) override;
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ FontData::FontData(int size, uint32 flags, int family, Font *other)
|
|||
f.setPixelSize(size);
|
||||
if (_flags & FontBold) {
|
||||
f.setBold(true);
|
||||
//} else if (fontFamilies[family] == "Open Sans Semibold") {
|
||||
// f.setWeight(QFont::DemiBold);
|
||||
} else if (fontFamilies[family] == "Open Sans Semibold" && cSemiboldFontIsBold()) {
|
||||
f.setBold(true);
|
||||
}
|
||||
f.setItalic(_flags & FontItalic);
|
||||
f.setUnderline(_flags & FontUnderline);
|
||||
|
|
|
|||
|
|
@ -109,6 +109,13 @@ void Start() {
|
|||
QFont::insertSubstitutions(qsl("Open Sans"), list);
|
||||
QFont::insertSubstitutions(qsl("Open Sans Semibold"), list);
|
||||
#endif // Q_OS_WIN || Q_OS_MAC
|
||||
|
||||
if (!cMainFont().isEmpty() && ValidateFont(cMainFont())) {
|
||||
OpenSansOverride = cMainFont();
|
||||
}
|
||||
if (!cSemiboldFont().isEmpty() && ValidateFont(cSemiboldFont())) {
|
||||
OpenSansSemiboldOverride = cSemiboldFont();
|
||||
}
|
||||
}
|
||||
|
||||
QString GetOverride(const QString &familyName) {
|
||||
|
|
|
|||
|
|
@ -555,7 +555,7 @@ void NativeManager::doShowNotification(
|
|||
&& (item->out() || peer->isSelf())
|
||||
&& item->isFromScheduled();
|
||||
const auto title = options.hideNameAndPhoto
|
||||
? qsl("Telegram Desktop")
|
||||
? qsl("Kotatogram Desktop")
|
||||
: (scheduled && peer->isSelf())
|
||||
? tr::lng_notification_reminder(tr::now)
|
||||
: App::peerName(peer);
|
||||
|
|
|
|||
|
|
@ -764,7 +764,7 @@ void Notification::updateNotifyDisplay() {
|
|||
p.setPen(st::dialogsNameFg);
|
||||
if (options.hideNameAndPhoto) {
|
||||
p.setFont(st::msgNameFont);
|
||||
static QString notifyTitle = st::msgNameFont->elided(qsl("Telegram Desktop"), rectForName.width());
|
||||
static QString notifyTitle = st::msgNameFont->elided(qsl("Kotatogram Desktop"), rectForName.width());
|
||||
p.drawText(rectForName.left(), rectForName.top() + st::msgNameFont->ascent, notifyTitle);
|
||||
} else if (reminder) {
|
||||
p.setFont(st::msgNameFont);
|
||||
|
|
|
|||
|
|
@ -202,11 +202,11 @@ MainMenu::MainMenu(
|
|||
refreshBackground();
|
||||
|
||||
_telegram->setMarkedText(Ui::Text::Link(
|
||||
qsl("Telegram Desktop"),
|
||||
qsl("https://desktop.telegram.org")));
|
||||
qsl("kotatogram Desktop"),
|
||||
qsl("https://t.me/kotatogram")));
|
||||
_telegram->setLinksTrusted();
|
||||
_version->setRichText(textcmdLink(1, tr::lng_settings_current_version(tr::now, lt_version, currentVersionText())) + QChar(' ') + QChar(8211) + QChar(' ') + textcmdLink(2, tr::lng_menu_about(tr::now)));
|
||||
_version->setLink(1, std::make_shared<UrlClickHandler>(qsl("https://desktop.telegram.org/changelog")));
|
||||
_version->setLink(1, std::make_shared<UrlClickHandler>(qsl("https://github.com/kotatogram/kotatogram-desktop")));
|
||||
_version->setLink(2, std::make_shared<LambdaClickHandler>([] { Ui::show(Box<AboutBox>()); }));
|
||||
|
||||
subscribe(_controller->session().downloaderTaskFinished(), [=] { update(); });
|
||||
|
|
|
|||