From c992e883b5f149956ee0de06da64ea0179b3dbe7 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 20 Mar 2026 15:16:56 +0300 Subject: [PATCH] [poll-view] Added toast when voting in hidden-results poll. --- Telegram/Resources/langs/lang.strings | 1 + .../SourceFiles/history/view/media/history_view_poll.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index f85e273fa2..743ffd6cf8 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -6853,6 +6853,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_polls_results_in_days#other" = "results in {count} days"; "lng_polls_ends_in_time" = "ends in {time}"; "lng_polls_results_in_time" = "results in {time}"; +"lng_polls_results_after_close" = "Results will appear after the poll ends."; "lng_polls_retract" = "Retract vote"; "lng_polls_stop" = "Stop poll"; "lng_polls_stop_warning" = "If you stop this poll now, nobody will be able to vote in it anymore. This action cannot be undone."; diff --git a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp index 70dc396307..a128715102 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp @@ -1331,6 +1331,13 @@ void Poll::updateVotes() { for (auto &answer : _answers) { answer.selected = false; } + if (_votedFromHere + && (_flags & PollData::Flag::HideResultsUntilClose) + && !(_flags & PollData::Flag::Closed)) { + _parent->delegate()->elementShowTooltip( + { tr::lng_polls_results_after_close(tr::now) }, + [] {}); + } } else { _votedFromHere = false; _hasSelected = false;