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:
parent
ddb08a37a4
commit
47a5486258
1 changed files with 17 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue