From 0f337ebbea5a611c4e0a5cfdd6748e0065cf7db4 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 28 Mar 2026 14:33:20 +0300 Subject: [PATCH] [poll-view] Fixed click handler for geo location as attached media. --- .../SourceFiles/history/view/media/history_view_poll.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp index a1475305a3..9c5947943a 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp @@ -387,6 +387,7 @@ struct Poll::Answer { struct Poll::AttachedMedia { std::shared_ptr thumbnail; + ClickHandlerPtr handler; PhotoData *photo = nullptr; std::shared_ptr photoMedia; QSize photoSize; @@ -946,6 +947,7 @@ void Poll::updateAttachedMedia() { } _attachedMediaCache = QImage(); _attachedMedia->thumbnail = updated.thumbnail; + _attachedMedia->handler = updated.handler; _attachedMedia->kind = updated.kind; _attachedMedia->rounded = updated.rounded; _attachedMedia->id = updated.id; @@ -2798,6 +2800,11 @@ TextState Poll::textState(QPoint point, StateRequest request) const { result.symbol = 0; return result; } + } else if (_attachedMedia + && _attachedMedia->handler + && QRect(0, tshift, width(), mediaHeight).contains(point)) { + result.link = _attachedMedia->handler; + return result; } tshift += mediaHeight + st::historyPollMediaSkip; }