2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-04 00:15:42 +00:00

Move poll results to a Info-like layer.

This commit is contained in:
John Preston
2020-01-15 14:53:42 +03:00
parent d0597407d8
commit 8c11e1724a
18 changed files with 458 additions and 108 deletions

View File

@@ -33,16 +33,24 @@ public:
Key(not_null<PeerData*> peer);
//Key(not_null<Data::Feed*> feed); // #feed
Key(Settings::Tag settings);
Key(not_null<PollData*> poll, FullMsgId contextId);
PeerData *peer() const;
//Data::Feed *feed() const; // #feed
UserData *settingsSelf() const;
PollData *poll() const;
FullMsgId pollContextId() const;
private:
struct PollKey {
not_null<PollData*> poll;
FullMsgId contextId;
};
base::variant<
not_null<PeerData*>,
//not_null<Data::Feed*>, // #feed
Settings::Tag> _value;
Settings::Tag,
PollKey> _value;
};
@@ -60,6 +68,7 @@ public:
Members,
//Channels, // #feed
Settings,
PollResults,
};
using SettingsType = ::Settings::Type;
using MediaType = Storage::SharedMediaType;
@@ -113,6 +122,10 @@ public:
UserData *settingsSelf() const {
return key().settingsSelf();
}
PollData *poll() const;
FullMsgId pollContextId() const {
return key().pollContextId();
}
virtual void setSearchEnabledByContent(bool enabled) {
}