Decrypt when downloading single events from the server
This fixes issues like not being able to view pinned messages in
encrypted rooms.
(cherry picked from commit 89e42dbc53)
# Conflicts:
# src/libneochat/neochatroom.cpp
This commit is contained in:
@@ -1602,6 +1602,12 @@ void NeoChatRoom::downloadEventFromServer(const QString &eventId)
|
|||||||
}
|
}
|
||||||
|
|
||||||
event_ptr_tt<RoomEvent> event = fromJson<event_ptr_tt<RoomEvent>>(job->jsonData());
|
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));
|
m_extraEvents.push_back(std::move(event));
|
||||||
Q_EMIT extraEventLoaded(eventId);
|
Q_EMIT extraEventLoaded(eventId);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user