2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Support limited formatting input in factcheck.

This commit is contained in:
John Preston
2024-05-24 11:23:27 +04:00
parent a3ef36f9f7
commit 97a5e0c6ea
16 changed files with 151 additions and 106 deletions

View File

@@ -199,18 +199,20 @@ void Factchecks::save(
void Factchecks::save(
FullMsgId itemId,
TextWithEntities was,
const TextWithEntities &was,
TextWithEntities text,
std::shared_ptr<Ui::Show> show) {
const auto done = [=](QString error) {
const auto wasEmpty = was.empty();
const auto textEmpty = text.empty();
save(itemId, std::move(text), [=](QString error) {
show->showToast(!error.isEmpty()
? error
: was.empty()
: wasEmpty
? tr::lng_factcheck_remove_done(tr::now)
: text.empty()
: textEmpty
? tr::lng_factcheck_add_done(tr::now)
: tr::lng_factcheck_edit_done(tr::now));
};
});
}
} // namespace Data

View File

@@ -45,7 +45,7 @@ public:
Fn<void(QString)> done);
void save(
FullMsgId itemId,
TextWithEntities was,
const TextWithEntities &was,
TextWithEntities text,
std::shared_ptr<Ui::Show> show);