From: Hypolite Petovan Date: Mon, 16 Aug 2021 09:29:17 +0000 (-0400) Subject: [advancedcontentfilter] Add new attachments key in filter X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b141416b51ee177b065fdc14fdd602902a0113ed;p=friendica-addons.git [advancedcontentfilter] Add new attachments key in filter - Follows a change in Model\Item::prepareBody to enable filtering on attachments (images, sounds, videos, downloads...) --- diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index bd97b309..f5a341fe 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -282,6 +282,7 @@ function advancedcontentfilter_build_fields($data) 'event_created', 'event_edited', 'event_start', 'event_finish', 'event_summary', 'event_desc', 'event_location', 'event_type', 'event_nofinish', 'event_adjust', 'event_ignore', 'children', 'pagedrop', 'tags', 'hashtags', 'mentions', + 'attachments', ]; $expressionLanguage = new ExpressionLanguage\ExpressionLanguage(); @@ -437,6 +438,10 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques $item['hashtags'] = $tags['hashtags']; $item['mentions'] = $tags['mentions']; + $attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? ''); + + $item['attachments'] = $attachments; + $return = advancedcontentfilter_get_filter_fields($item); return json_encode(['variables' => str_replace('\\\'', '\'', var_export($return, true))]);