mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-24 13:23:46 +00:00
[advancedcontentfilter] Add new attachments key in filter
- Follows a change in Model\Item::prepareBody to enable filtering on attachments (images, sounds, videos, downloads...)
This commit is contained in:
parent
1544fed2b9
commit
b141416b51
1 changed files with 5 additions and 0 deletions
|
@ -282,6 +282,7 @@ function advancedcontentfilter_build_fields($data)
|
||||||
'event_created', 'event_edited', 'event_start', 'event_finish', 'event_summary',
|
'event_created', 'event_edited', 'event_start', 'event_finish', 'event_summary',
|
||||||
'event_desc', 'event_location', 'event_type', 'event_nofinish', 'event_adjust', 'event_ignore',
|
'event_desc', 'event_location', 'event_type', 'event_nofinish', 'event_adjust', 'event_ignore',
|
||||||
'children', 'pagedrop', 'tags', 'hashtags', 'mentions',
|
'children', 'pagedrop', 'tags', 'hashtags', 'mentions',
|
||||||
|
'attachments',
|
||||||
];
|
];
|
||||||
|
|
||||||
$expressionLanguage = new ExpressionLanguage\ExpressionLanguage();
|
$expressionLanguage = new ExpressionLanguage\ExpressionLanguage();
|
||||||
|
@ -437,6 +438,10 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques
|
||||||
$item['hashtags'] = $tags['hashtags'];
|
$item['hashtags'] = $tags['hashtags'];
|
||||||
$item['mentions'] = $tags['mentions'];
|
$item['mentions'] = $tags['mentions'];
|
||||||
|
|
||||||
|
$attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? '');
|
||||||
|
|
||||||
|
$item['attachments'] = $attachments;
|
||||||
|
|
||||||
$return = advancedcontentfilter_get_filter_fields($item);
|
$return = advancedcontentfilter_get_filter_fields($item);
|
||||||
|
|
||||||
return json_encode(['variables' => str_replace('\\\'', '\'', var_export($return, true))]);
|
return json_encode(['variables' => str_replace('\\\'', '\'', var_export($return, true))]);
|
||||||
|
|
Loading…
Reference in a new issue