2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 23:45:44 +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

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/common_groups/info_common_groups_widget.h"
//#include "info/feed/info_feed_profile_widget.h" // #feed
#include "info/settings/info_settings_widget.h"
#include "info/polls/info_polls_results_widget.h"
#include "info/info_section_widget.h"
#include "info/info_layer_widget.h"
#include "info/info_controller.h"
@@ -42,6 +43,10 @@ Memento::Memento(Settings::Tag settings, Section section)
: Memento(DefaultStack(settings, section)) {
}
Memento::Memento(not_null<PollData*> poll, FullMsgId contextId)
: Memento(DefaultStack(poll, contextId)) {
}
Memento::Memento(std::vector<std::unique_ptr<ContentMemento>> stack)
: _stack(std::move(stack)) {
}
@@ -72,6 +77,14 @@ std::vector<std::unique_ptr<ContentMemento>> Memento::DefaultStack(
return result;
}
std::vector<std::unique_ptr<ContentMemento>> Memento::DefaultStack(
not_null<PollData*> poll,
FullMsgId contextId) {
auto result = std::vector<std::unique_ptr<ContentMemento>>();
result.push_back(std::make_unique<Polls::Memento>(poll, contextId));
return result;
}
Section Memento::DefaultSection(not_null<PeerData*> peer) {
if (peer->isSelf()) {
return Section(Section::MediaType::Photo);