From 0a10adfdfd90057e23a41fef4a7e97a322a80cf4 Mon Sep 17 00:00:00 2001 From: ZavaruKitsu Date: Sat, 1 Jul 2023 13:55:32 +0300 Subject: [PATCH] fix: allow up to 100 recent stickers fix: insert copyright --- Telegram/SourceFiles/ayu/ayu_lang.cpp | 7 ++++ Telegram/SourceFiles/ayu/ayu_lang.h | 7 ++++ Telegram/SourceFiles/ayu/ayu_settings.cpp | 9 ++++- Telegram/SourceFiles/ayu/ayu_settings.h | 7 ++++ Telegram/SourceFiles/ayu/ayu_state.cpp | 7 ++++ Telegram/SourceFiles/ayu/ayu_state.h | 7 ++++ .../ayu/boxes/confirmation_box.cpp | 7 ++++ .../SourceFiles/ayu/boxes/confirmation_box.h | 7 ++++ .../ayu/boxes/edit_deleted_mark.cpp | 7 ++++ .../SourceFiles/ayu/boxes/edit_deleted_mark.h | 7 ++++ .../ayu/boxes/edit_edited_mark.cpp | 7 ++++ .../SourceFiles/ayu/boxes/edit_edited_mark.h | 7 ++++ .../ayu/boxes/voice_confirmation_box.cpp | 13 +++---- .../ayu/boxes/voice_confirmation_box.h | 13 +++---- .../ayu/context_menu/context_menu.cpp | 7 ++++ .../ayu/context_menu/context_menu.h | 7 ++++ .../ayu/context_menu/message_history_box.cpp | 7 ++++ .../ayu/context_menu/message_history_box.h | 7 ++++ .../SourceFiles/ayu/database/ayu_database.cpp | 7 ++++ .../SourceFiles/ayu/database/ayu_database.h | 7 ++++ Telegram/SourceFiles/ayu/database/entities.h | 7 ++++ .../SourceFiles/ayu/settings/settings_ayu.cpp | 38 +++++++++++-------- .../SourceFiles/ayu/settings/settings_ayu.h | 7 ++++ .../ayu/utils/ayu_profile_values.cpp | 7 ++++ .../ayu/utils/ayu_profile_values.h | 7 ++++ .../history_view_voice_record_bar.cpp | 6 ++- 26 files changed, 193 insertions(+), 33 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ayu_lang.cpp b/Telegram/SourceFiles/ayu/ayu_lang.cpp index e7c1c8464..e6c9e1183 100644 --- a/Telegram/SourceFiles/ayu/ayu_lang.cpp +++ b/Telegram/SourceFiles/ayu/ayu_lang.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "ayu_lang.h" #include "qjsondocument.h" diff --git a/Telegram/SourceFiles/ayu/ayu_lang.h b/Telegram/SourceFiles/ayu/ayu_lang.h index a1ad32a3a..5c5a82dde 100644 --- a/Telegram/SourceFiles/ayu/ayu_lang.h +++ b/Telegram/SourceFiles/ayu/ayu_lang.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once #include diff --git a/Telegram/SourceFiles/ayu/ayu_settings.cpp b/Telegram/SourceFiles/ayu/ayu_settings.cpp index dc859f6da..8fe14ebb8 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.cpp +++ b/Telegram/SourceFiles/ayu/ayu_settings.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "ayu_settings.h" #include "rpl/lifetime.h" #include "rpl/producer.h" @@ -164,8 +171,6 @@ namespace AyuSettings { && sendOfflinePacketAfterOnline); } - - rpl::producer get_deletedMarkReactive() { return deletedMarkReactive.value(); } diff --git a/Telegram/SourceFiles/ayu/ayu_settings.h b/Telegram/SourceFiles/ayu/ayu_settings.h index 74c9a5de9..8d3577409 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.h +++ b/Telegram/SourceFiles/ayu/ayu_settings.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once #include "rpl/producer.h" diff --git a/Telegram/SourceFiles/ayu/ayu_state.cpp b/Telegram/SourceFiles/ayu/ayu_state.cpp index f3b2bc426..862c289f2 100644 --- a/Telegram/SourceFiles/ayu/ayu_state.cpp +++ b/Telegram/SourceFiles/ayu/ayu_state.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "ayu_state.h" namespace AyuState { diff --git a/Telegram/SourceFiles/ayu/ayu_state.h b/Telegram/SourceFiles/ayu/ayu_state.h index feb32b102..1fbb0c287 100644 --- a/Telegram/SourceFiles/ayu/ayu_state.h +++ b/Telegram/SourceFiles/ayu/ayu_state.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once #include "ayu_settings.h" diff --git a/Telegram/SourceFiles/ayu/boxes/confirmation_box.cpp b/Telegram/SourceFiles/ayu/boxes/confirmation_box.cpp index 6fc0ea2e6..e47103241 100644 --- a/Telegram/SourceFiles/ayu/boxes/confirmation_box.cpp +++ b/Telegram/SourceFiles/ayu/boxes/confirmation_box.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "confirmation_box.h" #include "ayu/ayu_settings.h" #include "window/window_session_controller.h" diff --git a/Telegram/SourceFiles/ayu/boxes/confirmation_box.h b/Telegram/SourceFiles/ayu/boxes/confirmation_box.h index 048e58a52..c9f06464f 100644 --- a/Telegram/SourceFiles/ayu/boxes/confirmation_box.h +++ b/Telegram/SourceFiles/ayu/boxes/confirmation_box.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "ui/layers/box_content.h" #include "window/window_main_menu.h" diff --git a/Telegram/SourceFiles/ayu/boxes/edit_deleted_mark.cpp b/Telegram/SourceFiles/ayu/boxes/edit_deleted_mark.cpp index 7530c12d8..395145c2c 100644 --- a/Telegram/SourceFiles/ayu/boxes/edit_deleted_mark.cpp +++ b/Telegram/SourceFiles/ayu/boxes/edit_deleted_mark.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "edit_deleted_mark.h" #include "lang/lang_keys.h" diff --git a/Telegram/SourceFiles/ayu/boxes/edit_deleted_mark.h b/Telegram/SourceFiles/ayu/boxes/edit_deleted_mark.h index b303b5152..e4d049084 100644 --- a/Telegram/SourceFiles/ayu/boxes/edit_deleted_mark.h +++ b/Telegram/SourceFiles/ayu/boxes/edit_deleted_mark.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once #include "boxes/abstract_box.h" diff --git a/Telegram/SourceFiles/ayu/boxes/edit_edited_mark.cpp b/Telegram/SourceFiles/ayu/boxes/edit_edited_mark.cpp index 4075b0e17..6aefb0d7e 100644 --- a/Telegram/SourceFiles/ayu/boxes/edit_edited_mark.cpp +++ b/Telegram/SourceFiles/ayu/boxes/edit_edited_mark.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "edit_edited_mark.h" #include "lang/lang_keys.h" diff --git a/Telegram/SourceFiles/ayu/boxes/edit_edited_mark.h b/Telegram/SourceFiles/ayu/boxes/edit_edited_mark.h index 966fa9cd0..1e4ed27c2 100644 --- a/Telegram/SourceFiles/ayu/boxes/edit_edited_mark.h +++ b/Telegram/SourceFiles/ayu/boxes/edit_edited_mark.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once #include "boxes/abstract_box.h" diff --git a/Telegram/SourceFiles/ayu/boxes/voice_confirmation_box.cpp b/Telegram/SourceFiles/ayu/boxes/voice_confirmation_box.cpp index 47acc98ce..0a375e813 100644 --- a/Telegram/SourceFiles/ayu/boxes/voice_confirmation_box.cpp +++ b/Telegram/SourceFiles/ayu/boxes/voice_confirmation_box.cpp @@ -1,10 +1,9 @@ -/* -This file is part of Telegram Desktop, -the official desktop application for the Telegram messaging service. - -For license and copyright information please follow this link: -https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -*/ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 #include "ui/boxes/confirm_box.h" #include "lang/lang_keys.h" diff --git a/Telegram/SourceFiles/ayu/boxes/voice_confirmation_box.h b/Telegram/SourceFiles/ayu/boxes/voice_confirmation_box.h index b3aa6c721..2c68ed69e 100644 --- a/Telegram/SourceFiles/ayu/boxes/voice_confirmation_box.h +++ b/Telegram/SourceFiles/ayu/boxes/voice_confirmation_box.h @@ -1,10 +1,9 @@ -/* -This file is part of Telegram Desktop, -the official desktop application for the Telegram messaging service. - -For license and copyright information please follow this link: -https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -*/ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 #pragma once #include "ui/layers/generic_box.h" diff --git a/Telegram/SourceFiles/ayu/context_menu/context_menu.cpp b/Telegram/SourceFiles/ayu/context_menu/context_menu.cpp index ddf5df590..b303ba607 100644 --- a/Telegram/SourceFiles/ayu/context_menu/context_menu.cpp +++ b/Telegram/SourceFiles/ayu/context_menu/context_menu.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "context_menu.h" #include "history/history_inner_widget.h" #include "lang_auto.h" diff --git a/Telegram/SourceFiles/ayu/context_menu/context_menu.h b/Telegram/SourceFiles/ayu/context_menu/context_menu.h index 8172b0ec8..47282e70c 100644 --- a/Telegram/SourceFiles/ayu/context_menu/context_menu.h +++ b/Telegram/SourceFiles/ayu/context_menu/context_menu.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once #include "history/history_inner_widget.h" diff --git a/Telegram/SourceFiles/ayu/context_menu/message_history_box.cpp b/Telegram/SourceFiles/ayu/context_menu/message_history_box.cpp index 4d40357d3..2c0970e6b 100644 --- a/Telegram/SourceFiles/ayu/context_menu/message_history_box.cpp +++ b/Telegram/SourceFiles/ayu/context_menu/message_history_box.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include #include #include diff --git a/Telegram/SourceFiles/ayu/context_menu/message_history_box.h b/Telegram/SourceFiles/ayu/context_menu/message_history_box.h index b8267abb5..73cc9e60c 100644 --- a/Telegram/SourceFiles/ayu/context_menu/message_history_box.h +++ b/Telegram/SourceFiles/ayu/context_menu/message_history_box.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include #include "ui/wrap/vertical_layout.h" #include "ui/widgets/scroll_area.h" diff --git a/Telegram/SourceFiles/ayu/database/ayu_database.cpp b/Telegram/SourceFiles/ayu/database/ayu_database.cpp index d619e1435..03703fac3 100644 --- a/Telegram/SourceFiles/ayu/database/ayu_database.cpp +++ b/Telegram/SourceFiles/ayu/database/ayu_database.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "ayu_database.h" #include "entities.h" diff --git a/Telegram/SourceFiles/ayu/database/ayu_database.h b/Telegram/SourceFiles/ayu/database/ayu_database.h index 09f1c9a2a..e050b9ca5 100644 --- a/Telegram/SourceFiles/ayu/database/ayu_database.h +++ b/Telegram/SourceFiles/ayu/database/ayu_database.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once #include "entities.h" diff --git a/Telegram/SourceFiles/ayu/database/entities.h b/Telegram/SourceFiles/ayu/database/entities.h index 5cb00b9e5..d425cd32e 100644 --- a/Telegram/SourceFiles/ayu/database/entities.h +++ b/Telegram/SourceFiles/ayu/database/entities.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once diff --git a/Telegram/SourceFiles/ayu/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/settings/settings_ayu.cpp index ebceb2b66..2971a07c9 100644 --- a/Telegram/SourceFiles/ayu/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/settings/settings_ayu.cpp @@ -1,4 +1,10 @@ -#include +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "ayu/boxes/edit_edited_mark.h" #include "ayu/boxes/edit_deleted_mark.h" #include "ayu/ayu_settings.h" @@ -22,6 +28,7 @@ #include "apiwrap.h" #include "api/api_blocked_peers.h" #include "ui/widgets/continuous_sliders.h" +#include "ui/boxes/single_choice_box.h" namespace Settings { @@ -180,7 +187,8 @@ namespace Settings { }, container->lifetime()); } - void Ayu::SetupCustomization(not_null container, not_null controller) { + void Ayu::SetupCustomization(not_null container, + not_null controller) { auto settings = &AyuSettings::getInstance(); AddSubsectionTitle(container, tr::ayu_CustomizationHeader()); @@ -242,9 +250,8 @@ namespace Settings { AddDividerText(container, tr::ayu_SettingsCustomizationHint()); } - - - void Ayu::SetupShowPeerId(not_null container, not_null controller) { + void Ayu::SetupShowPeerId(not_null container, + not_null controller) { auto settings = &AyuSettings::getInstance(); const auto options = std::vector{ @@ -253,7 +260,7 @@ namespace Settings { QString("Bot API") }; - auto currentVal = AyuSettings::get_showPeerId() | rpl::map([=] (int val) { + auto currentVal = AyuSettings::get_showPeerId() | rpl::map([=](int val) { return options[val]; }); @@ -263,7 +270,7 @@ namespace Settings { currentVal, st::settingsButtonNoIcon); button->addClickHandler([=] { - controller->show(Box([=](not_null box) { + controller->show(Box([=](not_null box) { const auto save = [=](int index) { settings->set_showPeerId(index); AyuSettings::save(); @@ -306,7 +313,7 @@ namespace Settings { updateLabel(settings->recentStickersCount); slider->setPseudoDiscrete( - 40 + 1, // thx tg + 100 + 1, // thx tg [=](int amount) { return amount; }, settings->recentStickersCount, [=](int amount) { updateLabel(amount); }, @@ -330,9 +337,9 @@ namespace Settings { )->toggleOn( rpl::single(settings->stickerConfirmation) )->toggledValue( - ) | rpl::filter([=] (bool enabled) { + ) | rpl::filter([=](bool enabled) { return (enabled != settings->stickerConfirmation); - }) | rpl::start_with_next([=] (bool enabled) { + }) | rpl::start_with_next([=](bool enabled) { settings->set_stickerConfirmation(enabled); AyuSettings::save(); }, container->lifetime()); @@ -344,9 +351,9 @@ namespace Settings { )->toggleOn( rpl::single(settings->GIFConfirmation) )->toggledValue( - ) | rpl::filter([=] (bool enabled) { + ) | rpl::filter([=](bool enabled) { return (enabled != settings->GIFConfirmation); - }) | rpl::start_with_next([=] (bool enabled) { + }) | rpl::start_with_next([=](bool enabled) { settings->set_GIFConfirmation(enabled); AyuSettings::save(); }, container->lifetime()); @@ -358,15 +365,16 @@ namespace Settings { )->toggleOn( rpl::single(settings->voiceConfirmation) )->toggledValue( - ) | rpl::filter([=] (bool enabled) { + ) | rpl::filter([=](bool enabled) { return (enabled != settings->voiceConfirmation); - }) | rpl::start_with_next([=] (bool enabled) { + }) | rpl::start_with_next([=](bool enabled) { settings->set_voiceConfirmation(enabled); AyuSettings::save(); }, container->lifetime()); } - void Ayu::SetupAyuGramSettings(not_null container, not_null controller) { + void Ayu::SetupAyuGramSettings(not_null container, + not_null controller) { AddSkip(container); SetupGhostEssentials(container); diff --git a/Telegram/SourceFiles/ayu/settings/settings_ayu.h b/Telegram/SourceFiles/ayu/settings/settings_ayu.h index 0998260ca..f6f581c4c 100644 --- a/Telegram/SourceFiles/ayu/settings/settings_ayu.h +++ b/Telegram/SourceFiles/ayu/settings/settings_ayu.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once #include "settings/settings_common.h" diff --git a/Telegram/SourceFiles/ayu/utils/ayu_profile_values.cpp b/Telegram/SourceFiles/ayu/utils/ayu_profile_values.cpp index 2fc23e75c..1f4c92148 100644 --- a/Telegram/SourceFiles/ayu/utils/ayu_profile_values.cpp +++ b/Telegram/SourceFiles/ayu/utils/ayu_profile_values.cpp @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #include "ui/text/text_utilities.h" #include "ayu/ayu_settings.h" #include "ayu_profile_values.h" diff --git a/Telegram/SourceFiles/ayu/utils/ayu_profile_values.h b/Telegram/SourceFiles/ayu/utils/ayu_profile_values.h index 2df8f2e0a..4b0f2cb70 100644 --- a/Telegram/SourceFiles/ayu/utils/ayu_profile_values.h +++ b/Telegram/SourceFiles/ayu/utils/ayu_profile_values.h @@ -1,3 +1,10 @@ +// This is the source code of AyuGram for Desktop. +// +// We do not and cannot prevent the use of our code, +// but be respectful and credit the original author. +// +// Copyright @Radolyn, 2023 + #pragma once diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp index 9ea643408..be6d21795 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp @@ -5,8 +5,6 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include -#include #include "history/view/controls/history_view_voice_record_bar.h" #include "api/api_send_progress.h" @@ -37,6 +35,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/effects/ripple_animation.h" #include "ui/text/format_values.h" #include "ui/painter.h" + +// AyuGram includes +#include "ayu/ayu_settings.h" +#include "ayu/boxes/voice_confirmation_box.h" #include "boxes/abstract_box.h" namespace HistoryView::Controls {