0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-04 14:48:56 +02:00

modules/client/sync: The structure sent from a longpoll has no need for a state, only timeline.

This commit is contained in:
Jason Volk 2018-09-06 23:08:20 -07:00
parent faf714335c
commit f24d51c38d

View file

@ -291,30 +291,8 @@ ircd::m::sync::longpoll::sync_room(client &client,
};
const m::event &event{accepted};
std::vector<std::string> state;
if(defined(json::get<"event_id"_>(event)) && defined(json::get<"state_key"_>(event)))
{
json::strung strung(event);
if(accepted.copts && accepted.copts->client_txnid)
strung = json::insert(strung, json::member
{
"unsigned", json::members
{
{ "transaction_id", accepted.copts->client_txnid }
}
});
state.emplace_back(std::move(strung));
}
const json::strung state_serial
{
state.data(), state.data() + state.size()
};
std::vector<std::string> timeline;
if(defined(json::get<"event_id"_>(event)) && !defined(json::get<"state_key"_>(event)))
if(defined(json::get<"event_id"_>(event)))
{
json::strung strung(event);
if(accepted.copts && accepted.copts->client_txnid)
@ -376,10 +354,6 @@ ircd::m::sync::longpoll::sync_room(client &client,
{
{ "events", ephemeral_serial },
}},
{ "state",
{
{ "events", state_serial }
}},
{ "timeline",
{
{ "events", timeline_serial },