mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Allow saving just the sticker in custom intro.
This commit is contained in:
@@ -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(),
|
||||
|
Reference in New Issue
Block a user