2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Allow removing cloud wallpapers.

This commit is contained in:
John Preston
2019-02-09 16:36:07 +03:00
parent f9d56eb4c1
commit b6e37b7730
7 changed files with 210 additions and 39 deletions

View File

@@ -3093,6 +3093,13 @@ void Session::setWallpapers(const QVector<MTPWallPaper> &data, int32 hash) {
}
}
void Session::removeWallpaper(const WallPaper &paper) {
const auto i = ranges::find(_wallpapers, paper.id(), &WallPaper::id);
if (i != end(_wallpapers)) {
_wallpapers.erase(i);
}
}
const std::vector<WallPaper> &Session::wallpapers() const {
return _wallpapers;
}

View File

@@ -539,6 +539,7 @@ public:
}
bool updateWallpapers(const MTPaccount_WallPapers &data);
void removeWallpaper(const WallPaper &paper);
const std::vector<WallPaper> &wallpapers() const;
int32 wallpapersHash() const;