Start adapting to libquotient crypto api changes

This commit is contained in:
Tobias Fella
2026-01-20 19:14:36 +01:00
committed by Tobias Fella
parent 9810b3dee0
commit 1ceffe6a2e
2 changed files with 8 additions and 0 deletions

View File

@@ -42,6 +42,10 @@ ecm_add_qml_module(Timeline GENERATE_PLUGIN_SOURCE
org.kde.neochat.libneochat
)
if(NOT TARGET Olm::Olm)
target_compile_definitions(Timeline PRIVATE -DRUST_CRYPTO)
endif()
target_include_directories(Timeline PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/enums ${CMAKE_CURRENT_SOURCE_DIR}/models)
target_link_libraries(Timeline PRIVATE
Qt::Core

View File

@@ -289,12 +289,16 @@ QVariant MessageModel::data(const QModelIndex &idx, int role) const
}
if (role == VerifiedRole) {
#ifdef RUST_CRYPTO
return m_room->connection()->isVerifiedEvent(event.value().get().id(), room());
#else
if (event.value().get().originalEvent()) {
auto encrypted = dynamic_cast<const EncryptedEvent *>(event.value().get().originalEvent());
Q_ASSERT(encrypted);
return eventRoom->connection()->isVerifiedSession(encrypted->sessionId().toLatin1());
}
return false;
#endif
}
if (role == AuthorDisplayNameRole) {