Skip to content

Commit

Permalink
ircd::m::typing: Drop typing events for rooms w/o local joined user.
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Dec 26, 2020
1 parent e888bf1 commit a5d3cfb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions matrix/typing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a5d3cfb

Please sign in to comment.