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

Pass Main::Session to click handler creators.

This commit is contained in:
John Preston
2020-06-09 13:36:40 +04:00
parent fc174f742a
commit 03dec15e8e
21 changed files with 117 additions and 93 deletions

View File

@@ -329,22 +329,16 @@ PhotoClickHandler::PhotoClickHandler(
not_null<PhotoData*> photo,
FullMsgId context,
PeerData *peer)
: FileClickHandler(context)
, _session(&photo->session())
: FileClickHandler(&photo->session(), context)
, _photo(photo)
, _peer(peer) {
}
void PhotoOpenClickHandler::onClickImpl() const {
if (valid()) {
Core::App().showPhoto(this);
}
Core::App().showPhoto(this);
}
void PhotoSaveClickHandler::onClickImpl() const {
if (!valid()) {
return;
}
const auto data = photo();
if (!data->date) {
return;
@@ -354,9 +348,6 @@ void PhotoSaveClickHandler::onClickImpl() const {
}
void PhotoCancelClickHandler::onClickImpl() const {
if (!valid()) {
return;
}
const auto data = photo();
if (!data->date) {
return;