Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F113682
D16.1732488483.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.1732488483.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
Sun, Nov 24, 2:48 PM (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39859
Default Alt Text
D16.1732488483.diff (1 KB)
Attached To
Mode
D16: Fix PostReceiptAction sending out a null json body
Attached
Detach File
Event Timeline
Log In to Comment