mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Removed unused methods from file click handler.
This commit is contained in:
parent
7c02d67665
commit
eb228eb744
2 changed files with 5 additions and 30 deletions
|
@ -10,18 +10,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/file_utilities.h"
|
||||
#include "data/data_document.h"
|
||||
#include "data/data_photo.h"
|
||||
#include "data/data_session.h"
|
||||
#include "main/main_session.h"
|
||||
|
||||
FileClickHandler::FileClickHandler(
|
||||
not_null<Main::Session*> session,
|
||||
FullMsgId context)
|
||||
: _session(session)
|
||||
, _context(context) {
|
||||
}
|
||||
|
||||
Main::Session &FileClickHandler::session() const {
|
||||
return *_session;
|
||||
FileClickHandler::FileClickHandler(FullMsgId context)
|
||||
: _context(context) {
|
||||
}
|
||||
|
||||
void FileClickHandler::setMessageId(FullMsgId context) {
|
||||
|
@ -32,10 +23,6 @@ FullMsgId FileClickHandler::context() const {
|
|||
return _context;
|
||||
}
|
||||
|
||||
HistoryItem *FileClickHandler::getActionItem() const {
|
||||
return _session->data().message(context());
|
||||
}
|
||||
|
||||
not_null<DocumentData*> DocumentClickHandler::document() const {
|
||||
return _document;
|
||||
}
|
||||
|
@ -55,7 +42,7 @@ void DocumentWrappedClickHandler::onClickImpl() const {
|
|||
DocumentClickHandler::DocumentClickHandler(
|
||||
not_null<DocumentData*> document,
|
||||
FullMsgId context)
|
||||
: FileClickHandler(&document->session(), context)
|
||||
: FileClickHandler(context)
|
||||
, _document(document) {
|
||||
}
|
||||
|
||||
|
@ -156,7 +143,7 @@ PhotoClickHandler::PhotoClickHandler(
|
|||
not_null<PhotoData*> photo,
|
||||
FullMsgId context,
|
||||
PeerData *peer)
|
||||
: FileClickHandler(&photo->session(), context)
|
||||
: FileClickHandler(context)
|
||||
, _photo(photo)
|
||||
, _peer(peer) {
|
||||
}
|
||||
|
|
|
@ -14,27 +14,15 @@ class DocumentData;
|
|||
class HistoryItem;
|
||||
class PhotoData;
|
||||
|
||||
namespace Main {
|
||||
class Session;
|
||||
} // namespace Main
|
||||
|
||||
class FileClickHandler : public LeftButtonClickHandler {
|
||||
public:
|
||||
FileClickHandler(
|
||||
not_null<Main::Session*> session,
|
||||
FullMsgId context);
|
||||
|
||||
[[nodiscard]] Main::Session &session() const;
|
||||
FileClickHandler(FullMsgId context);
|
||||
|
||||
void setMessageId(FullMsgId context);
|
||||
|
||||
[[nodiscard]] FullMsgId context() const;
|
||||
|
||||
protected:
|
||||
HistoryItem *getActionItem() const;
|
||||
|
||||
private:
|
||||
const not_null<Main::Session*> _session;
|
||||
FullMsgId _context;
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue