Skip to content

Commit

Permalink
Merge tag 'v5.2.2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyZavar committed Jul 2, 2024
2 parents a851beb + a507d28 commit f73edfe
Show file tree
Hide file tree
Showing 51 changed files with 408 additions and 176 deletions.
16 changes: 8 additions & 8 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -959,10 +959,10 @@ PRIVATE
history/history_view_highlight_manager.h
history/history_widget.cpp
history/history_widget.h
info/bot/earn/info_earn_inner_widget.cpp
info/bot/earn/info_earn_inner_widget.h
info/bot/earn/info_earn_widget.cpp
info/bot/earn/info_earn_widget.h
info/bot/earn/info_bot_earn_list.cpp
info/bot/earn/info_bot_earn_list.h
info/bot/earn/info_bot_earn_widget.cpp
info/bot/earn/info_bot_earn_widget.h
info/channel_statistics/boosts/create_giveaway_box.cpp
info/channel_statistics/boosts/create_giveaway_box.h
info/channel_statistics/boosts/giveaway/giveaway_list_controllers.cpp
Expand All @@ -971,10 +971,10 @@ PRIVATE
info/channel_statistics/boosts/info_boosts_inner_widget.h
info/channel_statistics/boosts/info_boosts_widget.cpp
info/channel_statistics/boosts/info_boosts_widget.h
info/channel_statistics/earn/info_earn_inner_widget.cpp
info/channel_statistics/earn/info_earn_inner_widget.h
info/channel_statistics/earn/info_earn_widget.cpp
info/channel_statistics/earn/info_earn_widget.h
info/channel_statistics/earn/info_channel_earn_list.cpp
info/channel_statistics/earn/info_channel_earn_list.h
info/channel_statistics/earn/info_channel_earn_widget.cpp
info/channel_statistics/earn/info_channel_earn_widget.h
info/common_groups/info_common_groups_inner_widget.cpp
info/common_groups/info_common_groups_inner_widget.h
info/common_groups/info_common_groups_widget.cpp
Expand Down
Binary file added Telegram/Resources/icons/menu/passcode_watch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Telegram/Resources/icons/menu/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_use_winhello_about" = "You need to enter your passcode once before unlocking Telegram with Windows Hello.";
"lng_settings_use_touchid" = "Unlock with Touch ID";
"lng_settings_use_touchid_about" = "You need to enter your passcode once before unlocking Telegram with Touch ID.";
"lng_settings_use_applewatch" = "Unlock with Apple Watch";
"lng_settings_use_applewatch_about" = "You need to enter your passcode once before unlocking Telegram with Apple Watch.";
"lng_settings_use_systempwd" = "Unlock with System Password";
"lng_settings_use_systempwd_about" = "You need to enter your passcode once before unlocking Telegram with System Password.";
"lng_settings_password_disable" = "Disable Cloud Password";
"lng_settings_password_abort" = "Abort two-step verification setup";
"lng_settings_about_bio" = "Any details such as age, occupation or city.\nExample: 23 y.o. designer from San Francisco";
Expand Down Expand Up @@ -998,6 +1002,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_passcode_logout" = "Log out";
"lng_passcode_winhello" = "You need to enter your passcode\nbefore you can use Windows Hello.";
"lng_passcode_touchid" = "You need to enter your passcode\nbefore you can use Touch ID.";
"lng_passcode_applewatch" = "You need to enter your passcode\nbefore you can use Watch to unlock.";
"lng_passcode_systempwd" = "You need to enter your passcode\nbefore you can use system password.";
"lng_passcode_winhello_unlock" = "Telegram wants to unlock with Windows Hello.";
"lng_passcode_touchid_unlock" = "unlock";
"lng_passcode_create_button" = "Save Passcode";
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Resources/uwp/AppX/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="5.2.0.0" />
Version="5.2.2.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Telegram.rc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,2,0,0
PRODUCTVERSION 5,2,0,0
FILEVERSION 5,2,2,0
PRODUCTVERSION 5,2,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Radolyn Labs"
VALUE "FileDescription", "AyuGram Desktop"
VALUE "FileVersion", "5.2.0.0"
VALUE "FileVersion", "5.2.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "AyuGram Desktop"
VALUE "ProductVersion", "5.2.0.0"
VALUE "ProductVersion", "5.2.2.0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions Telegram/Resources/winrc/Updater.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,2,0,0
PRODUCTVERSION 5,2,0,0
FILEVERSION 5,2,2,0
PRODUCTVERSION 5,2,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Radolyn Labs"
VALUE "FileDescription", "AyuGram Desktop Updater"
VALUE "FileVersion", "5.2.0.0"
VALUE "FileVersion", "5.2.2.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "AyuGram Desktop"
VALUE "ProductVersion", "5.2.0.0"
VALUE "ProductVersion", "5.2.2.0"
END
END
BLOCK "VarFileInfo"
Expand Down
13 changes: 5 additions & 8 deletions Telegram/SourceFiles/boxes/boxes.style
Original file line number Diff line number Diff line change
Expand Up @@ -293,21 +293,18 @@ passcodeSkip: 23px;
passcodeSystemUnlock: IconButton(defaultIconButton) {
width: 32px;
height: 36px;
icon: icon{{ "menu/passcode_winhello", lightButtonFg }};
iconOver: icon{{ "menu/passcode_winhello", lightButtonFg }};
iconPosition: point(4px, 4px);
rippleAreaSize: 32px;
rippleAreaPosition: point(0px, 0px);
ripple: RippleAnimation(defaultRippleAnimation) {
color: lightButtonBgOver;
}
}
passcodeSystemWinHello: IconButton(passcodeSystemUnlock) {
icon: icon{{ "menu/passcode_winhello", lightButtonFg }};
iconOver: icon{{ "menu/passcode_winhello", lightButtonFg }};
}
passcodeSystemTouchID: IconButton(passcodeSystemUnlock) {
icon: icon{{ "menu/passcode_finger", lightButtonFg }};
iconOver: icon{{ "menu/passcode_finger", lightButtonFg }};
}
passcodeSystemTouchID: icon{{ "menu/passcode_finger", lightButtonFg }};
passcodeSystemAppleWatch: icon{{ "menu/passcode_watch", lightButtonFg }};
passcodeSystemSystemPwd: icon{{ "menu/permissions", lightButtonFg }};
passcodeSystemUnlockLater: FlatLabel(defaultFlatLabel) {
align: align(top);
textFg: windowSubTextFg;
Expand Down
7 changes: 5 additions & 2 deletions Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ For license and copyright information please follow this link:
#include "data/data_premium_limits.h"
#include "data/data_user.h"
#include "history/admin_log/history_admin_log_section.h"
#include "info/bot/earn/info_earn_widget.h"
#include "info/bot/earn/info_bot_earn_widget.h"
#include "info/channel_statistics/boosts/info_boosts_widget.h"
#include "info/profile/info_profile_values.h"
#include "info/info_memento.h"
Expand Down Expand Up @@ -2200,8 +2200,11 @@ void Controller::saveForum() {
channel->inputChannel,
MTP_bool(*_savingData.forum)
)).done([=](const MTPUpdates &result) {
const auto weak = base::make_weak(this);
channel->session().api().applyUpdates(result);
continueSave();
if (weak) { // todo better to be able to save in closed already box.
continueSave();
}
}).fail([=](const MTP::Error &error) {
if (error.type() == u"CHAT_NOT_MODIFIED"_q) {
continueSave();
Expand Down
26 changes: 23 additions & 3 deletions Telegram/SourceFiles/core/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ For license and copyright information please follow this link:
#include "base/battery_saving.h"
#include "base/event_filter.h"
#include "base/concurrent_timer.h"
#include "base/options.h"
#include "base/qt_signal_producer.h"
#include "base/timer.h"
#include "base/unixtime.h"
Expand Down Expand Up @@ -144,10 +145,18 @@ void SetCrashAnnotationsGL() {
#endif // DESKTOP_APP_USE_ANGLE
}

base::options::toggle OptionSkipUrlSchemeRegister({
.id = kOptionSkipUrlSchemeRegister,
.name = "Skip URL scheme register",
.description = "Don't re-register tg:// URL scheme on autoupdate.",
});

} // namespace

Application *Application::Instance = nullptr;

const char kOptionSkipUrlSchemeRegister[] = "skip-url-scheme-register";

struct Application::Private {
base::Timer quitTimer;
UiIntegration uiIntegration;
Expand Down Expand Up @@ -265,9 +274,14 @@ void Application::run() {

refreshGlobalProxy(); // Depends on app settings being read.

if (const auto old = Local::oldSettingsVersion(); old < AppVersion) {
InvokeQueued(this, [] { RegisterUrlScheme(); });
Platform::NewVersionLaunched(old);
if (const auto old = Local::oldSettingsVersion()) {
if (old < AppVersion) {
autoRegisterUrlScheme();
Platform::NewVersionLaunched(old);
}
} else {
// Initial launch.
autoRegisterUrlScheme();
}

if (cAutoStart() && !Platform::AutostartSupported()) {
Expand Down Expand Up @@ -409,6 +423,12 @@ void Application::run() {
processCreatedWindow(_lastActivePrimaryWindow);
}

void Application::autoRegisterUrlScheme() {
if (!OptionSkipUrlSchemeRegister.value()) {
InvokeQueued(this, [] { RegisterUrlScheme(); });
}
}

void Application::showAccount(not_null<Main::Account*> account) {
if (const auto separate = separateWindowFor(account)) {
_lastActivePrimaryWindow = separate;
Expand Down
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/core/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ enum class QuitReason {
QtQuitEvent,
};

extern const char kOptionSkipUrlSchemeRegister[];

class Application final : public QObject {
public:
struct ProxyChange {
Expand Down Expand Up @@ -352,6 +354,7 @@ class Application final : public QObject {
friend bool IsAppLaunched();
friend Application &App();

void autoRegisterUrlScheme();
void clearEmojiSourceImages();
[[nodiscard]] auto prepareEmojiSourceImages()
-> std::shared_ptr<Ui::Emoji::UniversalImages>;
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/core/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D666}"_cs;
constexpr auto AppNameOld = "AyuGram for Windows"_cs;
constexpr auto AppName = "AyuGram Desktop"_cs;
constexpr auto AppFile = "AyuGram"_cs;
constexpr auto AppVersion = 5002000;
constexpr auto AppVersionStr = "5.2";
constexpr auto AppVersion = 5002002;
constexpr auto AppVersionStr = "5.2.2";
constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3690,6 +3690,9 @@ bool InnerWidget::chooseCollapsedRow(Qt::KeyboardModifiers modifiers) {
}

void InnerWidget::switchToFilter(FilterId filterId) {
if (_controller->windowId().type != Window::SeparateType::Primary) {
return;
}
const auto &list = session().data().chatsFilters().list();
const auto filterIt = filterId
? ranges::find(list, filterId, &Data::ChatFilter::id)
Expand Down
4 changes: 3 additions & 1 deletion Telegram/SourceFiles/dialogs/dialogs_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ ChatSearchTab SearchState::defaultTabForMe() const {
}

bool SearchState::filterChatsList() const {
return !inChat && (tab == ChatSearchTab::MyMessages);
using Tab = ChatSearchTab;
return !inChat // ThisPeer can be in opened forum.
&& (tab == Tab::MyMessages || tab == Tab::ThisPeer);
}

} // namespace Dialogs
5 changes: 5 additions & 0 deletions Telegram/SourceFiles/dialogs/ui/chat_search_in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Action final : public Ui::Menu::ItemBase {
std::shared_ptr<Ui::DynamicImage> icon,
const QString &label,
bool chosen);
~Action();

bool isEnabled() const override;
not_null<QAction*> action() const override;
Expand Down Expand Up @@ -111,6 +112,10 @@ Action::Action(
enableMouseSelecting();
}

Action::~Action() {
_icon->subscribeToUpdates(nullptr);
}

void Action::resolveMinWidth() {
const auto maxWidth = st::dialogsSearchInPhotoPadding
+ st::dialogsSearchInPhotoSize
Expand Down
35 changes: 24 additions & 11 deletions Telegram/SourceFiles/history/history_inner_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,9 @@ std::unique_ptr<QMimeData> HistoryInner::prepareDrag() {
updateDragSelection(nullptr, nullptr, false);
_selectScroll.cancel();

if (!urls.isEmpty()) mimeData->setUrls(urls);
if (!urls.isEmpty()) {
mimeData->setUrls(urls);
}
if (uponSelected && !_controller->adaptive().isOneColumn()) {
auto selectedState = getSelectionState();
if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) {
Expand All @@ -1757,34 +1759,45 @@ std::unique_ptr<QMimeData> HistoryInner::prepareDrag() {
== forwardSelectionState.canForwardCount)) {
forwardIds = getSelectedItems();
} else if (_mouseCursorState == CursorState::Date) {
forwardIds = session().data().itemOrItsGroup(_mouseActionItem);
const auto item = _mouseActionItem;
if (item && item->allowsForward()) {
forwardIds = session().data().itemOrItsGroup(item);
}
} else if ((pressedView->isHiddenByGroup() && pressedHandler)
|| (pressedView->media()
&& pressedView->media()->dragItemByHandler(pressedHandler))) {
const auto item = _dragStateItem
? _dragStateItem
: _mouseActionItem;
forwardIds = MessageIdsList(1, item->fullId());
}
if (forwardIds.empty()) {
return nullptr;
if (item && item->allowsForward()) {
forwardIds = MessageIdsList(1, item->fullId());
}
}
session().data().setMimeForwardIds(std::move(forwardIds));
auto result = std::make_unique<QMimeData>();
result->setData(u"application/x-td-forward"_q, "1");

if (pressedHandler) {
const auto lnkDocument = reinterpret_cast<DocumentData*>(
pressedHandler->property(
kDocumentLinkMediaProperty).toULongLong());
if (lnkDocument) {
const auto filepath = lnkDocument->filepath(true);
if (!filepath.isEmpty()) {
QList<QUrl> urls;
urls.push_back(QUrl::fromLocalFile(filepath));
result->setUrls(urls);
}
}
}

if (forwardIds.empty() && urls.isEmpty()) {
return nullptr;
}

auto result = std::make_unique<QMimeData>();
if (!forwardIds.empty()) {
session().data().setMimeForwardIds(std::move(forwardIds));
result->setData(u"application/x-td-forward"_q, "1");
}
if (!urls.isEmpty()) {
result->setUrls(urls);
}
return result;
}
return nullptr;
Expand Down
22 changes: 14 additions & 8 deletions Telegram/SourceFiles/history/view/history_view_list_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3786,25 +3786,31 @@ std::unique_ptr<QMimeData> ListWidget::prepareDrag() {
forwardIds = MessageIdsList(1, exactItem->fullId());
}
}
if (forwardIds.empty()) {
return nullptr;
}
session().data().setMimeForwardIds(std::move(forwardIds));
auto result = std::make_unique<QMimeData>();
result->setData(u"application/x-td-forward"_q, "1");

if (pressedHandler) {
const auto lnkDocument = reinterpret_cast<DocumentData*>(
pressedHandler->property(
kDocumentLinkMediaProperty).toULongLong());
if (lnkDocument) {
const auto filepath = lnkDocument->filepath(true);
if (!filepath.isEmpty()) {
QList<QUrl> urls;
urls.push_back(QUrl::fromLocalFile(filepath));
result->setUrls(urls);
}
}
}

if (forwardIds.empty() && urls.isEmpty()) {
return nullptr;
}

auto result = std::make_unique<QMimeData>();
if (!forwardIds.empty()) {
session().data().setMimeForwardIds(std::move(forwardIds));
result->setData(u"application/x-td-forward"_q, "1");
}
if (!urls.isEmpty()) {
result->setUrls(urls);
}
return result;
}
return nullptr;
Expand Down
Loading

0 comments on commit f73edfe

Please sign in to comment.