mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Show length limit when editing a factcheck.
This commit is contained in:
@@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "lang/lang_keys.h"
|
||||
#include "main/main_app_config.h"
|
||||
#include "main/main_session.h"
|
||||
#include "ui/layers/show.h"
|
||||
|
||||
namespace Data {
|
||||
namespace {
|
||||
@@ -196,4 +197,20 @@ void Factchecks::save(
|
||||
}
|
||||
}
|
||||
|
||||
void Factchecks::save(
|
||||
FullMsgId itemId,
|
||||
TextWithEntities was,
|
||||
TextWithEntities text,
|
||||
std::shared_ptr<Ui::Show> show) {
|
||||
const auto done = [=](QString error) {
|
||||
show->showToast(!error.isEmpty()
|
||||
? error
|
||||
: was.empty()
|
||||
? tr::lng_factcheck_remove_done(tr::now)
|
||||
: text.empty()
|
||||
? tr::lng_factcheck_add_done(tr::now)
|
||||
: tr::lng_factcheck_edit_done(tr::now));
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace Data
|
||||
|
@@ -21,6 +21,10 @@ namespace Main {
|
||||
class Session;
|
||||
} // namespace Main
|
||||
|
||||
namespace Ui {
|
||||
class Show;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Data {
|
||||
|
||||
class Factchecks final {
|
||||
@@ -39,6 +43,11 @@ public:
|
||||
FullMsgId itemId,
|
||||
TextWithEntities text,
|
||||
Fn<void(QString)> done);
|
||||
void save(
|
||||
FullMsgId itemId,
|
||||
TextWithEntities was,
|
||||
TextWithEntities text,
|
||||
std::shared_ptr<Ui::Show> show);
|
||||
|
||||
private:
|
||||
[[nodiscard]] bool canEdit() const;
|
||||
|
Reference in New Issue
Block a user