Notify on custom items - rework hooks

This commit is contained in:
M. Dent
2019-09-23 10:11:27 +02:00
committed by Mario
parent d1fd69337f
commit 7c5cfe6697
10 changed files with 90 additions and 32 deletions

View File

@@ -285,8 +285,21 @@ class Notifier {
}
if(! in_array(intval($target_item['item_type']), [ ITEM_TYPE_POST ] )) {
logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG);
return;
$hookinfo=[
'targetitem'=>$target_item,
'deliver'=>false
];
if (intval($target_item['item_type'] == ITEM_TYPE_CUSTOM)) {
call_hooks('customitem_deliver',$hookinfo);
}
if (!$hookinfo['deliver']) {
logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG);
return;
}
$target_item = $hookinfo['targetitem'];
}
// Check for non published items, but allow an exclusion for transmitting hidden file activities