mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix: allow up to 100 recent stickers
fix: insert copyright
This commit is contained in:
parent
243245d680
commit
0a10adfdfd
26 changed files with 193 additions and 33 deletions
|
@ -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 "ayu_lang.h"
|
||||||
|
|
||||||
#include "qjsondocument.h"
|
#include "qjsondocument.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
|
#pragma once
|
||||||
|
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
|
|
|
@ -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 "ayu_settings.h"
|
||||||
#include "rpl/lifetime.h"
|
#include "rpl/lifetime.h"
|
||||||
#include "rpl/producer.h"
|
#include "rpl/producer.h"
|
||||||
|
@ -164,8 +171,6 @@ namespace AyuSettings {
|
||||||
&& sendOfflinePacketAfterOnline);
|
&& sendOfflinePacketAfterOnline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rpl::producer<QString> get_deletedMarkReactive() {
|
rpl::producer<QString> get_deletedMarkReactive() {
|
||||||
return deletedMarkReactive.value();
|
return deletedMarkReactive.value();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
#pragma once
|
||||||
|
|
||||||
#include "rpl/producer.h"
|
#include "rpl/producer.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 "ayu_state.h"
|
#include "ayu_state.h"
|
||||||
|
|
||||||
namespace AyuState {
|
namespace AyuState {
|
||||||
|
|
|
@ -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
|
#pragma once
|
||||||
|
|
||||||
#include "ayu_settings.h"
|
#include "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
|
||||||
|
|
||||||
#include "confirmation_box.h"
|
#include "confirmation_box.h"
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.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 "ui/layers/box_content.h"
|
||||||
#include "window/window_main_menu.h"
|
#include "window/window_main_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
|
||||||
|
|
||||||
#include "edit_deleted_mark.h"
|
#include "edit_deleted_mark.h"
|
||||||
|
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.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
|
#pragma once
|
||||||
|
|
||||||
#include "boxes/abstract_box.h"
|
#include "boxes/abstract_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 "edit_edited_mark.h"
|
#include "edit_edited_mark.h"
|
||||||
|
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.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
|
#pragma once
|
||||||
|
|
||||||
#include "boxes/abstract_box.h"
|
#include "boxes/abstract_box.h"
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/*
|
// This is the source code of AyuGram for Desktop.
|
||||||
This file is part of Telegram Desktop,
|
//
|
||||||
the official desktop application for the Telegram messaging service.
|
// We do not and cannot prevent the use of our code,
|
||||||
|
// but be respectful and credit the original author.
|
||||||
For license and copyright information please follow this link:
|
//
|
||||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
// Copyright @Radolyn, 2023
|
||||||
*/
|
|
||||||
#include "ui/boxes/confirm_box.h"
|
#include "ui/boxes/confirm_box.h"
|
||||||
|
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/*
|
// This is the source code of AyuGram for Desktop.
|
||||||
This file is part of Telegram Desktop,
|
//
|
||||||
the official desktop application for the Telegram messaging service.
|
// We do not and cannot prevent the use of our code,
|
||||||
|
// but be respectful and credit the original author.
|
||||||
For license and copyright information please follow this link:
|
//
|
||||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
// Copyright @Radolyn, 2023
|
||||||
*/
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ui/layers/generic_box.h"
|
#include "ui/layers/generic_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 "context_menu.h"
|
#include "context_menu.h"
|
||||||
#include "history/history_inner_widget.h"
|
#include "history/history_inner_widget.h"
|
||||||
#include "lang_auto.h"
|
#include "lang_auto.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
|
#pragma once
|
||||||
|
|
||||||
#include "history/history_inner_widget.h"
|
#include "history/history_inner_widget.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 <styles/style_layers.h>
|
#include <styles/style_layers.h>
|
||||||
#include <styles/style_boxes.h>
|
#include <styles/style_boxes.h>
|
||||||
#include <ui/effects/scroll_content_shadow.h>
|
#include <ui/effects/scroll_content_shadow.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 <ui/layers/box_content.h>
|
||||||
#include "ui/wrap/vertical_layout.h"
|
#include "ui/wrap/vertical_layout.h"
|
||||||
#include "ui/widgets/scroll_area.h"
|
#include "ui/widgets/scroll_area.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 "ayu_database.h"
|
#include "ayu_database.h"
|
||||||
|
|
||||||
#include "entities.h"
|
#include "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
|
#pragma once
|
||||||
|
|
||||||
#include "entities.h"
|
#include "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
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#include <ui/boxes/single_choice_box.h>
|
// 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_edited_mark.h"
|
||||||
#include "ayu/boxes/edit_deleted_mark.h"
|
#include "ayu/boxes/edit_deleted_mark.h"
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
|
@ -22,6 +28,7 @@
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "api/api_blocked_peers.h"
|
#include "api/api_blocked_peers.h"
|
||||||
#include "ui/widgets/continuous_sliders.h"
|
#include "ui/widgets/continuous_sliders.h"
|
||||||
|
#include "ui/boxes/single_choice_box.h"
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
|
@ -180,7 +187,8 @@ namespace Settings {
|
||||||
}, container->lifetime());
|
}, container->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ayu::SetupCustomization(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> controller) {
|
void Ayu::SetupCustomization(not_null<Ui::VerticalLayout *> container,
|
||||||
|
not_null<Window::SessionController *> controller) {
|
||||||
auto settings = &AyuSettings::getInstance();
|
auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
AddSubsectionTitle(container, tr::ayu_CustomizationHeader());
|
AddSubsectionTitle(container, tr::ayu_CustomizationHeader());
|
||||||
|
@ -242,9 +250,8 @@ namespace Settings {
|
||||||
AddDividerText(container, tr::ayu_SettingsCustomizationHint());
|
AddDividerText(container, tr::ayu_SettingsCustomizationHint());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Ayu::SetupShowPeerId(not_null<Ui::VerticalLayout *> container,
|
||||||
|
not_null<Window::SessionController *> controller) {
|
||||||
void Ayu::SetupShowPeerId(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> controller) {
|
|
||||||
auto settings = &AyuSettings::getInstance();
|
auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
const auto options = std::vector{
|
const auto options = std::vector{
|
||||||
|
@ -253,7 +260,7 @@ namespace Settings {
|
||||||
QString("Bot API")
|
QString("Bot API")
|
||||||
};
|
};
|
||||||
|
|
||||||
auto currentVal = AyuSettings::get_showPeerId() | rpl::map([=] (int val) {
|
auto currentVal = AyuSettings::get_showPeerId() | rpl::map([=](int val) {
|
||||||
return options[val];
|
return options[val];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -263,7 +270,7 @@ namespace Settings {
|
||||||
currentVal,
|
currentVal,
|
||||||
st::settingsButtonNoIcon);
|
st::settingsButtonNoIcon);
|
||||||
button->addClickHandler([=] {
|
button->addClickHandler([=] {
|
||||||
controller->show(Box([=](not_null<Ui::GenericBox*> box) {
|
controller->show(Box([=](not_null<Ui::GenericBox *> box) {
|
||||||
const auto save = [=](int index) {
|
const auto save = [=](int index) {
|
||||||
settings->set_showPeerId(index);
|
settings->set_showPeerId(index);
|
||||||
AyuSettings::save();
|
AyuSettings::save();
|
||||||
|
@ -306,7 +313,7 @@ namespace Settings {
|
||||||
updateLabel(settings->recentStickersCount);
|
updateLabel(settings->recentStickersCount);
|
||||||
|
|
||||||
slider->setPseudoDiscrete(
|
slider->setPseudoDiscrete(
|
||||||
40 + 1, // thx tg
|
100 + 1, // thx tg
|
||||||
[=](int amount) { return amount; },
|
[=](int amount) { return amount; },
|
||||||
settings->recentStickersCount,
|
settings->recentStickersCount,
|
||||||
[=](int amount) { updateLabel(amount); },
|
[=](int amount) { updateLabel(amount); },
|
||||||
|
@ -330,9 +337,9 @@ namespace Settings {
|
||||||
)->toggleOn(
|
)->toggleOn(
|
||||||
rpl::single(settings->stickerConfirmation)
|
rpl::single(settings->stickerConfirmation)
|
||||||
)->toggledValue(
|
)->toggledValue(
|
||||||
) | rpl::filter([=] (bool enabled) {
|
) | rpl::filter([=](bool enabled) {
|
||||||
return (enabled != settings->stickerConfirmation);
|
return (enabled != settings->stickerConfirmation);
|
||||||
}) | rpl::start_with_next([=] (bool enabled) {
|
}) | rpl::start_with_next([=](bool enabled) {
|
||||||
settings->set_stickerConfirmation(enabled);
|
settings->set_stickerConfirmation(enabled);
|
||||||
AyuSettings::save();
|
AyuSettings::save();
|
||||||
}, container->lifetime());
|
}, container->lifetime());
|
||||||
|
@ -344,9 +351,9 @@ namespace Settings {
|
||||||
)->toggleOn(
|
)->toggleOn(
|
||||||
rpl::single(settings->GIFConfirmation)
|
rpl::single(settings->GIFConfirmation)
|
||||||
)->toggledValue(
|
)->toggledValue(
|
||||||
) | rpl::filter([=] (bool enabled) {
|
) | rpl::filter([=](bool enabled) {
|
||||||
return (enabled != settings->GIFConfirmation);
|
return (enabled != settings->GIFConfirmation);
|
||||||
}) | rpl::start_with_next([=] (bool enabled) {
|
}) | rpl::start_with_next([=](bool enabled) {
|
||||||
settings->set_GIFConfirmation(enabled);
|
settings->set_GIFConfirmation(enabled);
|
||||||
AyuSettings::save();
|
AyuSettings::save();
|
||||||
}, container->lifetime());
|
}, container->lifetime());
|
||||||
|
@ -358,15 +365,16 @@ namespace Settings {
|
||||||
)->toggleOn(
|
)->toggleOn(
|
||||||
rpl::single(settings->voiceConfirmation)
|
rpl::single(settings->voiceConfirmation)
|
||||||
)->toggledValue(
|
)->toggledValue(
|
||||||
) | rpl::filter([=] (bool enabled) {
|
) | rpl::filter([=](bool enabled) {
|
||||||
return (enabled != settings->voiceConfirmation);
|
return (enabled != settings->voiceConfirmation);
|
||||||
}) | rpl::start_with_next([=] (bool enabled) {
|
}) | rpl::start_with_next([=](bool enabled) {
|
||||||
settings->set_voiceConfirmation(enabled);
|
settings->set_voiceConfirmation(enabled);
|
||||||
AyuSettings::save();
|
AyuSettings::save();
|
||||||
}, container->lifetime());
|
}, container->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ayu::SetupAyuGramSettings(not_null<Ui::VerticalLayout *> container, not_null<Window::SessionController *> controller) {
|
void Ayu::SetupAyuGramSettings(not_null<Ui::VerticalLayout *> container,
|
||||||
|
not_null<Window::SessionController *> controller) {
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
SetupGhostEssentials(container);
|
SetupGhostEssentials(container);
|
||||||
|
|
||||||
|
|
|
@ -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
|
#pragma once
|
||||||
|
|
||||||
#include "settings/settings_common.h"
|
#include "settings/settings_common.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/text/text_utilities.h"
|
#include "ui/text/text_utilities.h"
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
#include "ayu_profile_values.h"
|
#include "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
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ the official desktop application for the Telegram messaging service.
|
||||||
For license and copyright information please follow this link:
|
For license and copyright information please follow this link:
|
||||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include <ayu/ayu_settings.h>
|
|
||||||
#include <ayu/boxes/voice_confirmation_box.h>
|
|
||||||
#include "history/view/controls/history_view_voice_record_bar.h"
|
#include "history/view/controls/history_view_voice_record_bar.h"
|
||||||
|
|
||||||
#include "api/api_send_progress.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/effects/ripple_animation.h"
|
||||||
#include "ui/text/format_values.h"
|
#include "ui/text/format_values.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
|
|
||||||
|
// AyuGram includes
|
||||||
|
#include "ayu/ayu_settings.h"
|
||||||
|
#include "ayu/boxes/voice_confirmation_box.h"
|
||||||
#include "boxes/abstract_box.h"
|
#include "boxes/abstract_box.h"
|
||||||
|
|
||||||
namespace HistoryView::Controls {
|
namespace HistoryView::Controls {
|
||||||
|
|
Loading…
Add table
Reference in a new issue