Simplify code

This commit is contained in:
Tobias Fella
2025-08-29 22:22:36 +02:00
parent 19e74b60a9
commit 91b00a34b7

View File

@@ -1252,10 +1252,8 @@ void NeoChatRoom::reportEvent(const QString &eventId, const QString &reason)
QByteArray NeoChatRoom::getEventJsonSource(const QString &eventId)
{
auto evtIt = findInTimeline(eventId);
if (evtIt != messageEvents().rend() && is<RoomEvent>(**evtIt)) {
const auto event = evtIt->viewAs<RoomEvent>();
return QJsonDocument(event->fullJson()).toJson();
if (const auto evtIt = findInTimeline(eventId); evtIt != messageEvents().rend() && is<RoomEvent>(**evtIt)) {
return QJsonDocument(evtIt->viewAs<RoomEvent>()->fullJson()).toJson();
}
return {};
}