mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Allow saving just the sticker in custom intro.
This commit is contained in:
parent
f95817861a
commit
139d1a9aa3
3 changed files with 7 additions and 6 deletions
|
@ -187,10 +187,14 @@ struct ChatIntro {
|
|||
QString description;
|
||||
DocumentData *sticker = nullptr;
|
||||
|
||||
explicit operator bool() const {
|
||||
[[nodiscard]] bool customPhrases() const {
|
||||
return !title.isEmpty() || !description.isEmpty();
|
||||
}
|
||||
|
||||
explicit operator bool() const {
|
||||
return customPhrases() || sticker;
|
||||
}
|
||||
|
||||
friend inline bool operator==(
|
||||
const ChatIntro &a,
|
||||
const ChatIntro &b) = default;
|
||||
|
|
|
@ -95,10 +95,10 @@ auto GenerateChatIntro(
|
|||
margins,
|
||||
links));
|
||||
};
|
||||
const auto title = data
|
||||
const auto title = data.customPhrases()
|
||||
? data.title
|
||||
: tr::lng_chat_intro_default_title(tr::now);
|
||||
const auto description = data
|
||||
const auto description = data.customPhrases()
|
||||
? data.description
|
||||
: tr::lng_chat_intro_default_message(tr::now);
|
||||
pushText(Ui::Text::Bold(title), st::chatIntroTitleMargin);
|
||||
|
|
|
@ -649,9 +649,6 @@ void ChatIntro::setupContent(
|
|||
void ChatIntro::save() {
|
||||
const auto show = controller()->uiShow();
|
||||
const auto fail = [=](QString error) {
|
||||
if (error == u"BUSINESS_RECIPIENTS_EMPTY"_q) {
|
||||
show->showToast(tr::lng_greeting_recipients_empty(tr::now));
|
||||
}
|
||||
};
|
||||
controller()->session().data().businessInfo().saveChatIntro(
|
||||
_intro.current(),
|
||||
|
|
Loading…
Add table
Reference in a new issue