Start adapting to libquotient crypto api changes
This commit is contained in:
committed by
Tobias Fella
parent
9810b3dee0
commit
1ceffe6a2e
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user