[poll-view] Fixed click handler for geo location as attached media.

This commit is contained in:
23rd
2026-03-28 14:33:20 +03:00
parent 65094326e8
commit 0f337ebbea
@@ -387,6 +387,7 @@ struct Poll::Answer {
struct Poll::AttachedMedia {
std::shared_ptr<Ui::DynamicImage> thumbnail;
ClickHandlerPtr handler;
PhotoData *photo = nullptr;
std::shared_ptr<Data::PhotoMedia> 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;
}