Page MenuHomePhorge

D16.1733020453.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D16.1733020453.diff

diff --git a/src/client/actions/ephemeral.cpp b/src/client/actions/ephemeral.cpp
--- a/src/client/actions/ephemeral.cpp
+++ b/src/client/actions/ephemeral.cpp
@@ -44,7 +44,8 @@
auto job = m.job<PostReceiptJob>().make(
a.roomId,
/* receiptType = */ "m.read"s,
- a.eventId)
+ a.eventId,
+ /* receipt = */ json::object())
.withData(json{{"roomId", a.roomId}});
m.addJob(std::move(job));
diff --git a/src/tests/client/room/read-receipt-test.cpp b/src/tests/client/room/read-receipt-test.cpp
--- a/src/tests/client/room/read-receipt-test.cpp
+++ b/src/tests/client/room/read-receipt-test.cpp
@@ -17,6 +17,7 @@
#include <room/room-model.hpp>
#include <sdk-model.hpp>
#include <client/client.hpp>
+#include <client/actions/ephemeral.hpp>
#include <cprjobhandler.hpp>
#include <lagerstoreeventemitter.hpp>
@@ -206,3 +207,15 @@
REQUIRE(postReceiptRoomId == r.roomId);
REQUIRE(postReceiptEventId == "$1");
}
+
+TEST_CASE("PostReceiptAction", "[client][room][receipt]")
+{
+ auto m = makeClient();
+ auto [next, _ignore] = updateClient(m, PostReceiptAction{"!someroom:example.com", "$someevent"});
+ assert1Job(next);
+ for1stJob(next, [](const BaseJob &job) {
+ REQUIRE(job.jobId() == "PostReceipt");
+ REQUIRE(job.url().find("rooms/!someroom:example.com/receipt/m.read/$someevent") != std::string::npos);
+ REQUIRE(json::parse(std::get<Bytes>(job.requestBody())) == json::object());
+ });
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 6:34 PM (15 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41777
Default Alt Text
D16.1733020453.diff (1 KB)

Event Timeline