PollHandler: Decrypt EncryptedEvents

Related events for a poll will be EncryptedEvents in an encrypted
room. Decrypt them before handling.
This commit is contained in:
Arno Rehn
2025-09-28 17:42:50 +02:00
parent a88a82ca08
commit e41fd7d986

View File

@@ -62,6 +62,12 @@ void PollHandler::checkLoadRelations(const QString &nextBatch)
void PollHandler::handleEvent(Quotient::RoomEvent *event)
{
if (auto encEvent = eventCast<const EncryptedEvent>(event)) {
const auto decrypted = room()->decryptMessage(*encEvent);
handleEvent(decrypted.get());
return;
}
auto pollStartEvent = eventCast<const PollStartEvent>(m_room->getEvent(m_pollStartId).first);
if (pollStartEvent == nullptr) {
return;