2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Move all (item/view/media) maps to Data::Session.

This commit is contained in:
John Preston
2018-01-17 19:21:01 +03:00
parent 7425e80f05
commit 8a56ede187
78 changed files with 2900 additions and 2320 deletions

View File

@@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_message.h"
#include "history/history_media_types.h"
#include "data/data_media_types.h"
#include "data/data_session.h"
#include "window/themes/window_theme_preview.h"
#include "window/window_peer_menu.h"
#include "observer_peer.h"
@@ -1299,7 +1300,7 @@ void MediaView::initGroupThumbs() {
_groupThumbs->activateRequests(
) | rpl::start_with_next([this](Media::View::GroupThumbs::Key key) {
if (const auto photoId = base::get_if<PhotoId>(&key)) {
const auto photo = App::photo(*photoId);
const auto photo = Auth().data().photo(*photoId);
moveToEntity({ photo, nullptr });
} else if (const auto itemId = base::get_if<FullMsgId>(&key)) {
moveToEntity(entityForItemId(*itemId));
@@ -2425,7 +2426,7 @@ MediaView::Entity MediaView::entityForUserPhotos(int index) const {
if (index < 0 || index >= _userPhotosData->size()) {
return { base::none, nullptr };
}
if (auto photo = App::photo((*_userPhotosData)[index])) {
if (auto photo = Auth().data().photo((*_userPhotosData)[index])) {
return { photo, nullptr };
}
return { base::none, nullptr };