From 9cb5f317c6fbce0b44592cba2efb87d71d9a6f6a Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Mon, 21 Feb 2022 12:00:00 +0000 Subject: [PATCH 1/2] update mtxclient --- CMakeLists.txt | 2 +- io.github.NhekoReborn.Nheko.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a211b1f6..aa5c1ecd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -405,7 +405,7 @@ if(USE_BUNDLED_MTXCLIENT) FetchContent_Declare( MatrixClient GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git - GIT_TAG 31a703c9febdfcaaf4e8a74abd424b6fc462e573 + GIT_TAG 6b522aee53f9300539544bd956cbf5284a4ae768 ) set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "") set(BUILD_LIB_TESTS OFF CACHE INTERNAL "") diff --git a/io.github.NhekoReborn.Nheko.yaml b/io.github.NhekoReborn.Nheko.yaml index b8ee7f82..f017c11d 100644 --- a/io.github.NhekoReborn.Nheko.yaml +++ b/io.github.NhekoReborn.Nheko.yaml @@ -189,7 +189,7 @@ modules: buildsystem: cmake-ninja name: mtxclient sources: - - commit: 31a703c9febdfcaaf4e8a74abd424b6fc462e573 + - commit: 6b522aee53f9300539544bd956cbf5284a4ae768 #tag: v0.6.1 type: git url: https://github.com/Nheko-Reborn/mtxclient.git From 05f7e47a9fe7710973ae59fb7f42609a837b93e2 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sun, 20 Feb 2022 12:00:00 +0000 Subject: [PATCH 2/2] support for hidden read receipts --- src/timeline/EventStore.cpp | 8 ++++++-- src/timeline/TimelineModel.cpp | 16 ++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp index 78920ac4..8e244f42 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp @@ -16,6 +16,7 @@ #include "EventAccessors.h" #include "Logging.h" #include "MatrixClient.h" +#include "UserSettingsPage.h" #include "Utils.h" Q_DECLARE_METATYPE(Reaction) @@ -220,11 +221,14 @@ EventStore::EventStore(std::string room_id, QObject *) } http::client()->read_event( - room_id_, event_id, [this, event_id](mtx::http::RequestErr err) { + room_id_, + event_id, + [this, event_id](mtx::http::RequestErr err) { if (err) { nhlog::net()->warn("failed to read_event ({}, {})", room_id_, event_id); } - }); + }, + !UserSettings::instance()->readReceipts()); auto idx = idToIndex(event_id); diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index fe92fcf7..64cff6b8 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -1077,12 +1077,16 @@ TimelineModel::setCurrentIndex(int index) void TimelineModel::readEvent(const std::string &id) { - http::client()->read_event(room_id_.toStdString(), id, [this](mtx::http::RequestErr err) { - if (err) { - nhlog::net()->warn( - "failed to read_event ({}, {})", room_id_.toStdString(), currentId.toStdString()); - } - }); + http::client()->read_event( + room_id_.toStdString(), + id, + [this](mtx::http::RequestErr err) { + if (err) { + nhlog::net()->warn( + "failed to read_event ({}, {})", room_id_.toStdString(), currentId.toStdString()); + } + }, + !UserSettings::instance()->readReceipts()); } QString