0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

ircd:Ⓜ️:v1: Support request to /state_ids/ as option in m::v1::state.

This commit is contained in:
Jason Volk 2018-04-02 17:38:35 -07:00
parent b5060a5e46
commit baccd4b767
2 changed files with 3 additions and 1 deletions

View file

@ -35,6 +35,7 @@ struct ircd::m::v1::state::opts
{
net::hostport remote;
string_view event_id;
bool ids_only {false};
m::request request;
server::out out;
server::in in;

View file

@ -310,7 +310,8 @@ ircd::m::v1::state::state(const room::id &room_id,
thread_local char urlbuf[2048], ridbuf[768], eidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/state/%s/?event_id=%s",
urlbuf, "/_matrix/federation/v1/%s/%s/?event_id=%s",
opts.ids_only? "state_ids" : "state",
url::encode(room_id, ridbuf),
url::encode(opts.event_id, eidbuf),
};