mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd:Ⓜ️:push: Add branch to handle other pattern key for content rules.
This commit is contained in:
parent
6f17864cd7
commit
7861f77015
1 changed files with 12 additions and 4 deletions
|
@ -73,12 +73,20 @@ ircd::m::push::match::match(const event &event,
|
|||
const match::opts &opts)
|
||||
:boolean{[&event, &rule, &opts]
|
||||
{
|
||||
const auto &conditions
|
||||
if(json::get<"pattern"_>(rule))
|
||||
{
|
||||
json::get<"conditions"_>(rule)
|
||||
const push::cond cond
|
||||
{
|
||||
{ "kind", "event_match" },
|
||||
{ "key", "content.body" },
|
||||
{ "pattern", json::get<"pattern"_>(rule) },
|
||||
};
|
||||
|
||||
for(const json::object &cond : conditions)
|
||||
if(!match(event, cond, opts))
|
||||
return false;
|
||||
}
|
||||
|
||||
for(const json::object &cond : json::get<"conditions"_>(rule))
|
||||
if(!match(event, push::cond(cond), opts))
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue