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

ircd:Ⓜ️:fed: Mitigate some remaining event_id.host() to derive a remote.

This commit is contained in:
Jason Volk 2020-03-07 13:10:20 -08:00
parent a068981452
commit dddb8e4254

View file

@ -466,9 +466,10 @@ ircd::m::fed::query_auth::query_auth(const m::room::id &room_id,
opts opts)
:server::request{[&]
{
if(!opts.remote)
if(!opts.remote && event_id.version() == "1")
opts.remote = event_id.host();
assert(!!opts.remote);
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
@ -528,9 +529,13 @@ ircd::m::fed::event_auth::event_auth(const m::room::id &room_id,
opts opts)
:server::request{[&]
{
if(!opts.remote)
if(!opts.remote && event_id.version() == "1")
opts.remote = event_id.host();
if(!opts.remote)
opts.remote = room_id.host();
assert(!!opts.remote);
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
@ -595,9 +600,10 @@ ircd::m::fed::event::event(const m::event::id &event_id,
opts opts)
:server::request{[&]
{
if(!opts.remote)
if(!opts.remote && event_id.version() == "1")
opts.remote = event_id.host();
assert(!!opts.remote);
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();