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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user