Added support of unread poll votes to corner button from history widget.

This commit is contained in:
23rd
2026-03-24 12:37:53 +03:00
parent d1406f3f17
commit b01e0b77fe
32 changed files with 481 additions and 25 deletions
@@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mtproto/mtproto_config.h"
#include "window/notifications_manager.h"
#include "history/history.h"
#include "history/history_item.h"
#include "history/history_item_components.h"
#include "history/view/media/history_view_media.h"
#include "history/view/history_view_element.h"
@@ -4464,6 +4465,23 @@ void Session::applyUpdate(const MTPDupdateMessagePoll &update) {
if (updated && updated->applyResults(update.vresults())) {
notifyPollUpdateDelayed(updated);
}
if (const auto tlPeer = update.vpeer()) {
const auto peer = peerFromMTP(*tlPeer);
if (const auto history = historyLoaded(peer)) {
histories().requestDialogEntry(history);
}
} else if (updated) {
if (const auto i = _pollViews.find(updated)
; i != _pollViews.end()) {
for (const auto &view : i->second) {
if (view->data()->hasUnreadPollVote()) {
histories().requestDialogEntry(
view->data()->history());
break;
}
}
}
}
}
void Session::applyUpdate(const MTPDupdateChatParticipants &update) {