0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 00:14:07 +01:00

modules/m_event: Enforce m.ignored_user_list for events to client.

This commit is contained in:
Jason Volk 2019-03-14 17:31:34 -07:00
parent ddb08a37a4
commit 47a5486258

View file

@ -494,6 +494,23 @@ ircd::m::append(json::stack::object &object,
};
#endif
if(!json::get<"state_key"_>(event) && has_user)
{
const m::user::ignores ignores{*opts.user_id};
if(ignores.enforce("events") && ignores.has(json::get<"sender"_>(event)))
{
log::debug
{
log, "Not sending event '%s' because '%s' is ignored by '%s'",
json::get<"event_id"_>(event),
json::get<"sender"_>(event),
string_view{*opts.user_id}
};
return;
}
}
object.append(event);
if(json::get<"state_key"_>(event) && has_event_idx)