From 81f40586a3bd1a4b72d120b79b469de8524805b0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 24 Apr 2023 22:47:31 +0400 Subject: [PATCH] Don't re-apply exactly the same custom chat wallpaper. --- Telegram/SourceFiles/boxes/background_preview_box.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/boxes/background_preview_box.cpp b/Telegram/SourceFiles/boxes/background_preview_box.cpp index 3573a261e..2c3167e13 100644 --- a/Telegram/SourceFiles/boxes/background_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/background_preview_box.cpp @@ -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(