mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 09:40:12 +01:00
ircd:Ⓜ️:filter: Condition on contains_url in match definition.
This commit is contained in:
parent
b414593443
commit
0478ead6d9
1 changed files with 5 additions and 0 deletions
|
@ -1436,10 +1436,15 @@ ircd::m::events::for_each(const uint64_t &start,
|
|||
//
|
||||
|
||||
//TODO: globular expression
|
||||
//TODO: tribool for contains_url; we currently ignore the false value.
|
||||
bool
|
||||
ircd::m::match(const room_event_filter &filter,
|
||||
const event &event)
|
||||
{
|
||||
if(json::get<"contains_url"_>(filter) == true)
|
||||
if(!at<"content"_>(event).has("url"))
|
||||
return false;
|
||||
|
||||
for(const auto &room_id : json::get<"not_rooms"_>(filter))
|
||||
if(at<"room_id"_>(event) == unquote(room_id))
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue