Page MenuHomePhorge

D165.1732566511.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D165.1732566511.diff

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

Mime Type
text/plain
Expires
Mon, Nov 25, 12:28 PM (13 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39508
Default Alt Text
D165.1732566511.diff (2 KB)

Event Timeline