2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Use initial bot web app header/body colors.

This commit is contained in:
John Preston
2024-11-11 19:08:06 +04:00
parent 2d1fb0562d
commit 7bf78b3317
8 changed files with 142 additions and 72 deletions

View File

@@ -345,6 +345,24 @@ void UserData::setBotInfo(const MTPBotInfo &info) {
const auto privacyChanged = (botInfo->privacyPolicyUrl != privacy);
botInfo->privacyPolicyUrl = privacy;
if (const auto settings = d.vapp_settings()) {
const auto &data = settings->data();
botInfo->botAppColorTitleDay = Ui::MaybeColorFromSerialized(
data.vheader_color()).value_or(QColor(0, 0, 0, 0));
botInfo->botAppColorTitleNight = Ui::MaybeColorFromSerialized(
data.vheader_dark_color()).value_or(QColor(0, 0, 0, 0));
botInfo->botAppColorBodyDay = Ui::MaybeColorFromSerialized(
data.vbackground_color()).value_or(QColor(0, 0, 0, 0));
botInfo->botAppColorBodyNight = Ui::MaybeColorFromSerialized(
data.vbackground_dark_color()).value_or(QColor(0, 0, 0, 0));
} else {
botInfo->botAppColorTitleDay
= botInfo->botAppColorTitleNight
= botInfo->botAppColorBodyDay
= botInfo->botAppColorBodyNight
= QColor(0, 0, 0, 0);
}
if (changedCommands || changedButton || privacyChanged) {
owner().botCommandsChanged(this);
}