mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Save Data::Session* in GameData.
This commit is contained in:
parent
2b11e45692
commit
01c1096c62
4 changed files with 17 additions and 19 deletions
|
@ -407,6 +407,7 @@ PRIVATE
|
|||
data/data_file_origin.cpp
|
||||
data/data_file_origin.h
|
||||
data/data_flags.h
|
||||
data/data_game.cpp
|
||||
data/data_game.h
|
||||
data/data_group_call.cpp
|
||||
data/data_group_call.h
|
||||
|
|
13
Telegram/SourceFiles/data/data_game.cpp
Normal file
13
Telegram/SourceFiles/data/data_game.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "data/data_game.h"
|
||||
|
||||
GameData::GameData(not_null<Data::Session*> owner, const GameId &id)
|
||||
: owner(owner)
|
||||
, id(id) {
|
||||
}
|
|
@ -11,25 +11,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "data/data_document.h"
|
||||
|
||||
struct GameData {
|
||||
GameData(const GameId &id) : id(id) {
|
||||
}
|
||||
GameData(
|
||||
const GameId &id,
|
||||
const uint64 &accessHash,
|
||||
const QString &shortName,
|
||||
const QString &title,
|
||||
const QString &description,
|
||||
PhotoData *photo,
|
||||
DocumentData *document)
|
||||
: id(id)
|
||||
, accessHash(accessHash)
|
||||
, shortName(shortName)
|
||||
, title(title)
|
||||
, description(description)
|
||||
, photo(photo)
|
||||
, document(document) {
|
||||
}
|
||||
GameData(not_null<Data::Session*> owner, const GameId &id);
|
||||
|
||||
const not_null<Data::Session*> owner;
|
||||
GameId id = 0;
|
||||
uint64 accessHash = 0;
|
||||
QString shortName;
|
||||
|
|
|
@ -3041,7 +3041,7 @@ void Session::webpageApplyFields(
|
|||
not_null<GameData*> Session::game(GameId id) {
|
||||
auto i = _games.find(id);
|
||||
if (i == _games.cend()) {
|
||||
i = _games.emplace(id, std::make_unique<GameData>(id)).first;
|
||||
i = _games.emplace(id, std::make_unique<GameData>(this, id)).first;
|
||||
}
|
||||
return i->second.get();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue