mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 23:15:59 +00:00
Save themes, apply and close editor on save.
This commit is contained in:
@@ -162,18 +162,10 @@ void Uploader::uploadMedia(
|
||||
media.document,
|
||||
base::duplicate(media.photoThumbs.front().second));
|
||||
if (!media.data.isEmpty()) {
|
||||
document->setData(media.data);
|
||||
document->setDataAndCache(media.data);
|
||||
if (media.type == SendMediaType::ThemeFile) {
|
||||
document->checkWallPaperProperties();
|
||||
}
|
||||
if (document->saveToCache()
|
||||
&& media.data.size() <= Storage::kMaxFileInMemory) {
|
||||
Auth().data().cache().put(
|
||||
document->cacheKey(),
|
||||
Storage::Cache::Database::TaggedValue(
|
||||
base::duplicate(media.data),
|
||||
document->cacheTag()));
|
||||
}
|
||||
}
|
||||
if (!media.file.isEmpty()) {
|
||||
document->setLocation(FileLocation(media.file));
|
||||
@@ -206,18 +198,10 @@ void Uploader::upload(
|
||||
std::move(file->goodThumbnail),
|
||||
std::move(file->goodThumbnailBytes));
|
||||
if (!file->content.isEmpty()) {
|
||||
document->setData(file->content);
|
||||
document->setDataAndCache(file->content);
|
||||
if (file->type == SendMediaType::ThemeFile) {
|
||||
document->checkWallPaperProperties();
|
||||
}
|
||||
if (document->saveToCache()
|
||||
&& file->content.size() <= Storage::kMaxFileInMemory) {
|
||||
Auth().data().cache().put(
|
||||
document->cacheKey(),
|
||||
Storage::Cache::Database::TaggedValue(
|
||||
base::duplicate(file->content),
|
||||
document->cacheTag()));
|
||||
}
|
||||
}
|
||||
if (!file->filepath.isEmpty()) {
|
||||
document->setLocation(FileLocation(file->filepath));
|
||||
|
Reference in New Issue
Block a user