From c3dcd5f586b228fa80efd35fa039b9c8a24e3529 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 16 Jan 2019 16:46:01 -0800 Subject: [PATCH] modules/client/sync/rooms/state: Add fetch options w/ json request. --- modules/client/sync/rooms/state.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/client/sync/rooms/state.cc b/modules/client/sync/rooms/state.cc index db6f7352b..24c5d999e 100644 --- a/modules/client/sync/rooms/state.cc +++ b/modules/client/sync/rooms/state.cc @@ -23,6 +23,8 @@ namespace ircd::m::sync static void room_state_linear(data &); extern const event::keys::include _default_keys; + extern const event::fetch::opts _default_fopts; + extern item room_state; } @@ -48,6 +50,14 @@ ircd::m::sync::_default_keys "type", }; +decltype(ircd::m::sync::_default_fopts) +ircd::m::sync::_default_fopts{[] +{ + event::fetch::opts ret{_default_keys}; + ret.query_json_force = true; + return ret; +}()}; + void ircd::m::sync::room_state_linear(data &data) { @@ -87,14 +97,9 @@ ircd::m::sync::room_state_polylog_events(data &data) const event::closure_idx each_idx{[&data, &array, &mutex] (const m::event::idx &event_idx) { - static const m::event::fetch::opts fopts - { - _default_keys - }; - const event::fetch event { - event_idx, std::nothrow, fopts + event_idx, std::nothrow, _default_fopts }; if(!event.valid)