Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112359
D165.1732300439.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D165.1732300439.diff
View Options
diff --git a/src/client/actions/sync.cpp b/src/client/actions/sync.cpp
--- a/src/client/actions/sync.cpp
+++ b/src/client/actions/sync.cpp
@@ -121,7 +121,7 @@
zug::map([=](Event e) -> KazvEvent {
return ReceivingRoomAccountDataEvent{std::move(e), id};
}),
- room.state.value().events).transient());
+ room.accountData.value().events).transient());
updateRoomImpl(id, AddAccountDataAction{room.accountData.value().events});
}
};
diff --git a/src/tests/client/sync-test.cpp b/src/tests/client/sync-test.cpp
--- a/src/tests/client/sync-test.cpp
+++ b/src/tests/client/sync-test.cpp
@@ -440,6 +440,34 @@
REQUIRE(toDevice.size() == 1);
REQUIRE(toDevice[0].sender() == "@alice:example.com");
}
+
+ SECTION("emits account data changes") {
+ auto nextTriggers = store.reader().get().nextTriggers;
+ auto triggerContains = [=](auto p) {
+ return std::any_of(
+ nextTriggers.begin(),
+ nextTriggers.end(),
+ [=](const KazvEvent &t) {
+ if (!std::holds_alternative<ReceivingRoomAccountDataEvent>(t)) {
+ return false;
+ }
+ auto e = std::get<ReceivingRoomAccountDataEvent>(t);
+ return p(e);
+ });
+ };
+
+ REQUIRE(triggerContains([](const auto &e) {
+ return e.event.type() == "m.tag" && e.roomId == "!726s6s6q:example.com";
+ }));
+
+ REQUIRE(triggerContains([](const auto &e) {
+ return e.event.type() == "m.fully_read" && e.roomId == "!726s6s6q:example.com";
+ }));
+
+ REQUIRE(triggerContains([](const auto &e) {
+ return e.event.type() == "org.example.custom.room.config" && e.roomId == "!726s6s6q:example.com";
+ }));
+ }
}
TEST_CASE("Sync should record state events in timeline", "[client][sync]")
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 10:33 AM (11 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38880
Default Alt Text
D165.1732300439.diff (2 KB)
Attached To
Mode
D165: Fix room account data not emitted properly
Attached
Detach File
Event Timeline
Log In to Comment