mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Drop custom wallpaper on theme change.
This commit is contained in:
parent
352ae5100a
commit
da7d4687ca
1 changed files with 14 additions and 0 deletions
|
@ -281,11 +281,25 @@ void ChooseThemeController::initButtons() {
|
||||||
const auto now = chosen->key ? _chosen.current() : QString();
|
const auto now = chosen->key ? _chosen.current() : QString();
|
||||||
if (was != now) {
|
if (was != now) {
|
||||||
_peer->setThemeEmoji(now);
|
_peer->setThemeEmoji(now);
|
||||||
|
const auto dropWallPaper = (_peer->wallPaper() != nullptr);
|
||||||
|
if (dropWallPaper) {
|
||||||
|
_peer->setWallPaper({});
|
||||||
|
}
|
||||||
|
|
||||||
if (chosen->theme) {
|
if (chosen->theme) {
|
||||||
// Remember while changes propagate through event loop.
|
// Remember while changes propagate through event loop.
|
||||||
_controller->pushLastUsedChatTheme(chosen->theme);
|
_controller->pushLastUsedChatTheme(chosen->theme);
|
||||||
}
|
}
|
||||||
const auto api = &_peer->session().api();
|
const auto api = &_peer->session().api();
|
||||||
|
api->request(MTPmessages_SetChatWallPaper(
|
||||||
|
MTP_flags(0),
|
||||||
|
_peer->input,
|
||||||
|
MTPInputWallPaper(),
|
||||||
|
MTPWallPaperSettings(),
|
||||||
|
MTPint()
|
||||||
|
)).afterDelay(10).done([=](const MTPUpdates &result) {
|
||||||
|
api->applyUpdates(result);
|
||||||
|
}).send();
|
||||||
api->request(MTPmessages_SetChatTheme(
|
api->request(MTPmessages_SetChatTheme(
|
||||||
_peer->input,
|
_peer->input,
|
||||||
MTP_string(now)
|
MTP_string(now)
|
||||||
|
|
Loading…
Add table
Reference in a new issue