Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F115130
D16.1732640788.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16.1732640788.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 9:06 AM (19 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40595
Default Alt Text
D16.1732640788.diff (1 KB)
Attached To
Mode
D16: Fix PostReceiptAction sending out a null json body
Attached
Detach File
Event Timeline
Log In to Comment