mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
QString description;
|
||||||
DocumentData *sticker = nullptr;
|
DocumentData *sticker = nullptr;
|
||||||
|
|
||||||
explicit operator bool() const {
|
[[nodiscard]] bool customPhrases() const {
|
||||||
return !title.isEmpty() || !description.isEmpty();
|
return !title.isEmpty() || !description.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
explicit operator bool() const {
|
||||||
|
return customPhrases() || sticker;
|
||||||
|
}
|
||||||
|
|
||||||
friend inline bool operator==(
|
friend inline bool operator==(
|
||||||
const ChatIntro &a,
|
const ChatIntro &a,
|
||||||
const ChatIntro &b) = default;
|
const ChatIntro &b) = default;
|
||||||
|
|
|
@ -95,10 +95,10 @@ auto GenerateChatIntro(
|
||||||
margins,
|
margins,
|
||||||
links));
|
links));
|
||||||
};
|
};
|
||||||
const auto title = data
|
const auto title = data.customPhrases()
|
||||||
? data.title
|
? data.title
|
||||||
: tr::lng_chat_intro_default_title(tr::now);
|
: tr::lng_chat_intro_default_title(tr::now);
|
||||||
const auto description = data
|
const auto description = data.customPhrases()
|
||||||
? data.description
|
? data.description
|
||||||
: tr::lng_chat_intro_default_message(tr::now);
|
: tr::lng_chat_intro_default_message(tr::now);
|
||||||
pushText(Ui::Text::Bold(title), st::chatIntroTitleMargin);
|
pushText(Ui::Text::Bold(title), st::chatIntroTitleMargin);
|
||||||
|
|
|
@ -649,9 +649,6 @@ void ChatIntro::setupContent(
|
||||||
void ChatIntro::save() {
|
void ChatIntro::save() {
|
||||||
const auto show = controller()->uiShow();
|
const auto show = controller()->uiShow();
|
||||||
const auto fail = [=](QString error) {
|
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(
|
controller()->session().data().businessInfo().saveChatIntro(
|
||||||
_intro.current(),
|
_intro.current(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue