ircd:Ⓜ️:typing: Drop typing events for rooms w/o local joined user.

This commit is contained in:
Jason Volk 2020-12-26 09:59:12 -08:00
parent e888bf1827
commit a5d3cfbfa6
1 changed files with 15 additions and 0 deletions

View File

@ -264,6 +264,21 @@ ircd::m::typing::_handle_edu(const m::event &event,
return;
}
// Check if we're even interested in data for this room.
if(!my_host(origin))
if(!m::local_joined(room_id))
{
log::dwarning
{
log, "Ignoring %s from '%s' in %s :no local users joined.",
at<"type"_>(event),
origin,
string_view{room_id},
};
return;
}
// Check if this server can write to the room based on the m.room.server_acl.
if(!my_host(origin))
if(m::room::server_acl::enable_write && !m::room::server_acl::check(room_id, origin))