From f95d66a914b74c5114ea2054e6a44a483ed31df4 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 27 Apr 2019 16:00:56 -0700 Subject: [PATCH] modules/federation/event_auth: Use visibility call for all logic rather than special case here. --- modules/federation/event_auth.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/federation/event_auth.cc b/modules/federation/event_auth.cc index efeb75d08..6f41286d8 100644 --- a/modules/federation/event_auth.cc +++ b/modules/federation/event_auth.cc @@ -74,7 +74,7 @@ get__event_auth(client &client, { static const m::event::fetch::opts fopts { - m::event::keys::include {"type", "state_key", "content"} + m::event::keys::include {"room_id", "sender", "type", "state_key", "content"} }; const m::event::fetch event @@ -82,9 +82,7 @@ get__event_auth(client &client, event_id, fopts }; - if(at<"type"_>(event) == "m.room.member") - if(m::user::id(at<"state_key"_>(event)).host() == request.origin) - visible = true; + visible = m::visible(event, request.node_id); } if(!visible)