mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added creator flag to PollData.
This commit is contained in:
@@ -104,7 +104,8 @@ bool PollData::applyChanges(const MTPDpoll &poll) {
|
||||
| (poll.is_open_answers() ? Flag::OpenAnswers : Flag(0))
|
||||
| (poll.is_hide_results_until_close()
|
||||
? Flag::HideResultsUntilClose
|
||||
: Flag(0));
|
||||
: Flag(0))
|
||||
| (poll.is_creator() ? Flag::Creator : Flag(0));
|
||||
const auto newCloseDate = poll.vclose_date().value_or_empty();
|
||||
const auto newClosePeriod = poll.vclose_period().value_or_empty();
|
||||
auto newAnswers = ranges::views::all(
|
||||
@@ -350,6 +351,10 @@ bool PollData::hideResultsUntilClose() const {
|
||||
return (_flags & Flag::HideResultsUntilClose);
|
||||
}
|
||||
|
||||
bool PollData::creator() const {
|
||||
return (_flags & Flag::Creator);
|
||||
}
|
||||
|
||||
MTPInputMedia PollMediaToMTP(const PollMedia &media) {
|
||||
if (media.photo) {
|
||||
return MTP_inputMediaPhoto(
|
||||
|
||||
@@ -60,14 +60,15 @@ struct PollData {
|
||||
[[nodiscard]] Main::Session &session() const;
|
||||
|
||||
enum class Flag {
|
||||
Closed = 0x01,
|
||||
PublicVotes = 0x02,
|
||||
MultiChoice = 0x04,
|
||||
Quiz = 0x08,
|
||||
ShuffleAnswers = 0x10,
|
||||
RevotingDisabled = 0x20,
|
||||
OpenAnswers = 0x40,
|
||||
HideResultsUntilClose = 0x80,
|
||||
Closed = 0x001,
|
||||
PublicVotes = 0x002,
|
||||
MultiChoice = 0x004,
|
||||
Quiz = 0x008,
|
||||
ShuffleAnswers = 0x010,
|
||||
RevotingDisabled = 0x020,
|
||||
OpenAnswers = 0x040,
|
||||
HideResultsUntilClose = 0x080,
|
||||
Creator = 0x100,
|
||||
};
|
||||
friend inline constexpr bool is_flag_type(Flag) { return true; };
|
||||
using Flags = base::flags<Flag>;
|
||||
@@ -92,6 +93,7 @@ struct PollData {
|
||||
[[nodiscard]] bool revotingDisabled() const;
|
||||
[[nodiscard]] bool openAnswers() const;
|
||||
[[nodiscard]] bool hideResultsUntilClose() const;
|
||||
[[nodiscard]] bool creator() const;
|
||||
|
||||
PollId id = 0;
|
||||
TextWithEntities question;
|
||||
|
||||
Reference in New Issue
Block a user