Decrypt when downloading single events from the server

This fixes issues like not being able to view pinned messages in
encrypted rooms.
This commit is contained in:
Joshua Goins
2026-01-11 18:28:23 -05:00
parent ba57570dbf
commit 89e42dbc53

View File

@@ -1657,6 +1657,12 @@ void NeoChatRoom::downloadEventFromServer(const QString &eventId)
}
event_ptr_tt<RoomEvent> event = fromJson<event_ptr_tt<RoomEvent>>(job->jsonData());
if (auto encEv = eventCast<EncryptedEvent>(event.get())) {
auto decryptedEvent = decryptMessage(*encEv);
if (decryptedEvent) {
event = std::move(decryptedEvent);
}
}
m_extraEvents.push_back(std::move(event));
Q_EMIT extraEventLoaded(eventId);
},