2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Option to always use old forward method

This commit is contained in:
RadRussianRus
2021-09-20 15:56:58 +03:00
parent 2daaf3f402
commit 61761f99fd
7 changed files with 20 additions and 1 deletions

View File

@@ -253,5 +253,7 @@
"ktg_forward_grouping_mode_regroup": "Regroup media",
"ktg_forward_grouping_mode_regroup_desc": "Unquoted and uncaptioned only",
"ktg_forward_grouping_mode_separate": "Separate",
"ktg_forward_force_old_unquoted": "Old unquoted forward method",
"ktg_forward_force_old_unquoted_desc": "Old method copies messages content on client rather than server. Currently it's used only for \"Regroup media\" grouping mode, since new one doesn't support it. If for some reason unquoted forward doesn't work correctly, try switching this option.",
"dummy_last_string": ""
}

View File

@@ -271,5 +271,7 @@
"ktg_forward_grouping_mode_regroup": "Объединить медиа",
"ktg_forward_grouping_mode_regroup_desc": "Только без автора и без подписей",
"ktg_forward_grouping_mode_separate": "По отдельности",
"ktg_forward_force_old_unquoted": "Старый метод пересылки без автора",
"ktg_forward_force_old_unquoted_desc": "Старый метод копирует содержимое сообщений на клиенте вместо сервера. Сейчас он используется только в режиме группировки «Объединить медиа», так как новый его не поддерживает. Если по какой-то причине пересылка без автора не работает, попробуйте поменять эту настройку.",
"dummy_last_string": ""
}

View File

@@ -3632,7 +3632,8 @@ void ApiWrap::forwardMessages(
const SendAction &action,
FnMut<void()> &&successCallback) {
if (draft.options != Data::ForwardOptions::PreserveInfo
&& draft.groupOptions == Data::GroupingOptions::RegroupAll) {
&& (draft.groupOptions == Data::GroupingOptions::RegroupAll
|| cForwardForceOld())) {
forwardMessagesUnquoted(std::move(draft), action, std::move(successCallback));
return;
}

View File

@@ -394,6 +394,7 @@ QByteArray GenerateSettingsJson(bool areDefault = false) {
settings.insert(qsl("forward_remember_mode"), cForwardRememberMode());
settings.insert(qsl("forward_mode"), ForwardMode());
settings.insert(qsl("forward_grouping_mode"), ForwardGroupingMode());
settings.insert(qsl("forward_force_old_unquoted"), cForwardForceOld());
settingsFonts.insert(qsl("size"), cFontSize());
settingsFonts.insert(qsl("use_system_font"), cUseSystemFont());
@@ -988,6 +989,9 @@ bool Manager::readCustomFile() {
SetForwardGroupingMode(v);
}
});
ReadBoolOption(settings, "forward_force_old_unquoted", [&](auto v) {
cSetForwardForceOld(v);
});
return true;
}

View File

@@ -292,3 +292,5 @@ int ForwardGroupingMode() {
rpl::producer<int> ForwardGroupingModeChanges() {
return gForwardGroupingMode.changes();
}
bool gForwardForceOld = false;

View File

@@ -184,3 +184,5 @@ void SetForwardMode(int mode);
void SetForwardGroupingMode(int mode);
[[nodiscard]] int ForwardGroupingMode();
[[nodiscard]] rpl::producer<int> ForwardGroupingModeChanges();
DeclareSetting(bool, ForwardForceOld);

View File

@@ -490,6 +490,12 @@ void SetupKotatoForward(not_null<Ui::VerticalLayout*> container) {
}, false));
});
SettingsMenuCSwitch(ktg_forward_force_old_unquoted, ForwardForceOld);
AddSkip(container);
AddDividerText(container, rktr("ktg_forward_force_old_unquoted_desc"));
AddSkip(container);
SettingsMenuCSwitch(ktg_settings_forward_retain_selection, ForwardRetainSelection);
SettingsMenuCSwitch(ktg_settings_forward_chat_on_click, ForwardChatOnClick);