mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
rpcClear for mediaview, ImageLink changed to Location
This commit is contained in:
@@ -49,8 +49,8 @@ namespace {
|
||||
PhotosData photosData;
|
||||
DocumentsData documentsData;
|
||||
|
||||
typedef QHash<QString, ImageLinkData*> ImageLinksData;
|
||||
ImageLinksData imageLinksData;
|
||||
typedef QHash<LocationCoords, LocationData*> LocationsData;
|
||||
LocationsData locationsData;
|
||||
|
||||
typedef QHash<WebPageId, WebPageData*> WebPagesData;
|
||||
WebPagesData webPagesData;
|
||||
@@ -1671,27 +1671,14 @@ namespace App {
|
||||
return result;
|
||||
}
|
||||
|
||||
ImageLinkData *imageLink(const QString &imageLink) {
|
||||
ImageLinksData::const_iterator i = imageLinksData.constFind(imageLink);
|
||||
if (i == imageLinksData.cend()) {
|
||||
i = imageLinksData.insert(imageLink, new ImageLinkData(imageLink));
|
||||
LocationData *location(const LocationCoords &coords) {
|
||||
LocationsData::const_iterator i = locationsData.constFind(coords);
|
||||
if (i == locationsData.cend()) {
|
||||
i = locationsData.insert(coords, new LocationData(coords));
|
||||
}
|
||||
return i.value();
|
||||
}
|
||||
|
||||
ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type) {
|
||||
ImageLinksData::const_iterator i = imageLinksData.constFind(imageLink);
|
||||
ImageLinkData *result;
|
||||
if (i == imageLinksData.cend()) {
|
||||
result = new ImageLinkData(imageLink);
|
||||
imageLinksData.insert(imageLink, result);
|
||||
result->type = type;
|
||||
} else {
|
||||
result = i.value();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void forgetMedia() {
|
||||
lastPhotos.clear();
|
||||
lastPhotosMap.clear();
|
||||
@@ -1701,7 +1688,7 @@ namespace App {
|
||||
for (DocumentsData::const_iterator i = ::documentsData.cbegin(), e = ::documentsData.cend(); i != e; ++i) {
|
||||
i.value()->forget();
|
||||
}
|
||||
for (ImageLinksData::const_iterator i = imageLinksData.cbegin(), e = imageLinksData.cend(); i != e; ++i) {
|
||||
for (LocationsData::const_iterator i = ::locationsData.cbegin(), e = ::locationsData.cend(); i != e; ++i) {
|
||||
i.value()->thumb->forget();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user