Don't re-apply exactly the same custom chat wallpaper.

This commit is contained in:
John Preston 2023-04-24 22:47:31 +04:00
parent 40deda1e9b
commit 81f40586a3
1 changed files with 6 additions and 0 deletions

View File

@ -590,6 +590,12 @@ void BackgroundPreviewBox::uploadForPeer() {
void BackgroundPreviewBox::setExistingForPeer(const Data::WallPaper &paper) {
Expects(_forPeer != nullptr);
if (const auto already = _forPeer->wallPaper()) {
if (already->equals(paper)) {
_controller->finishChatThemeEdit(_forPeer);
return;
}
}
const auto api = &_controller->session().api();
using Flag = MTPmessages_SetChatWallPaper::Flag;
api->request(MTPmessages_SetChatWallPaper(