Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F113265
D165.1732435021.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.1732435021.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
Sat, Nov 23, 11:57 PM (11 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39508
Default Alt Text
D165.1732435021.diff (2 KB)
Attached To
Mode
D165: Fix room account data not emitted properly
Attached
Detach File
Event Timeline
Log In to Comment