diff --git a/Telegram/SourceFiles/data/data_poll.cpp b/Telegram/SourceFiles/data/data_poll.cpp index cfe3fde142..3973bab3ae 100644 --- a/Telegram/SourceFiles/data/data_poll.cpp +++ b/Telegram/SourceFiles/data/data_poll.cpp @@ -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( diff --git a/Telegram/SourceFiles/data/data_poll.h b/Telegram/SourceFiles/data/data_poll.h index 59f25c4413..c2a4c09470 100644 --- a/Telegram/SourceFiles/data/data_poll.h +++ b/Telegram/SourceFiles/data/data_poll.h @@ -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; @@ -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;