Merge pull request #952 from symphorien/hidden-read-receipts

support for hidden read receipts
This commit is contained in:
DeepBlueV7.X 2022-02-22 16:30:23 +00:00 committed by GitHub
commit 3dfcc4145d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 10 deletions

View file

@ -405,7 +405,7 @@ if(USE_BUNDLED_MTXCLIENT)
FetchContent_Declare( FetchContent_Declare(
MatrixClient MatrixClient
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git 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_EXAMPLES OFF CACHE INTERNAL "")
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "") set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")

View file

@ -189,7 +189,7 @@ modules:
buildsystem: cmake-ninja buildsystem: cmake-ninja
name: mtxclient name: mtxclient
sources: sources:
- commit: 31a703c9febdfcaaf4e8a74abd424b6fc462e573 - commit: 6b522aee53f9300539544bd956cbf5284a4ae768
#tag: v0.6.1 #tag: v0.6.1
type: git type: git
url: https://github.com/Nheko-Reborn/mtxclient.git url: https://github.com/Nheko-Reborn/mtxclient.git

View file

@ -16,6 +16,7 @@
#include "EventAccessors.h" #include "EventAccessors.h"
#include "Logging.h" #include "Logging.h"
#include "MatrixClient.h" #include "MatrixClient.h"
#include "UserSettingsPage.h"
#include "Utils.h" #include "Utils.h"
Q_DECLARE_METATYPE(Reaction) Q_DECLARE_METATYPE(Reaction)
@ -220,11 +221,14 @@ EventStore::EventStore(std::string room_id, QObject *)
} }
http::client()->read_event( 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) { if (err) {
nhlog::net()->warn("failed to read_event ({}, {})", room_id_, event_id); nhlog::net()->warn("failed to read_event ({}, {})", room_id_, event_id);
} }
}); },
!UserSettings::instance()->readReceipts());
auto idx = idToIndex(event_id); auto idx = idToIndex(event_id);

View file

@ -1077,12 +1077,16 @@ TimelineModel::setCurrentIndex(int index)
void void
TimelineModel::readEvent(const std::string &id) TimelineModel::readEvent(const std::string &id)
{ {
http::client()->read_event(room_id_.toStdString(), id, [this](mtx::http::RequestErr err) { http::client()->read_event(
if (err) { room_id_.toStdString(),
nhlog::net()->warn( id,
"failed to read_event ({}, {})", room_id_.toStdString(), currentId.toStdString()); [this](mtx::http::RequestErr err) {
} if (err) {
}); nhlog::net()->warn(
"failed to read_event ({}, {})", room_id_.toStdString(), currentId.toStdString());
}
},
!UserSettings::instance()->readReceipts());
} }
QString QString