aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Notifier.php
diff options
context:
space:
mode:
authorM. Dent <dentm42@gmail.com>2019-09-23 10:11:27 +0200
committerMario <mario@mariovavti.com>2019-09-23 10:11:27 +0200
commit7c5cfe66973a8e529c01c3a214e9f8b791c89c23 (patch)
tree6ef8f96a07a0bbff51b1712dbaf4cda9e3e9b623 /Zotlabs/Daemon/Notifier.php
parentd1fd69337fa87ec10264919ffcb0bbe57f8873d2 (diff)
downloadvolse-hubzilla-7c5cfe66973a8e529c01c3a214e9f8b791c89c23.tar.gz
volse-hubzilla-7c5cfe66973a8e529c01c3a214e9f8b791c89c23.tar.bz2
volse-hubzilla-7c5cfe66973a8e529c01c3a214e9f8b791c89c23.zip
Notify on custom items - rework hooks
Diffstat (limited to 'Zotlabs/Daemon/Notifier.php')
-rw-r--r--Zotlabs/Daemon/Notifier.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index 15dc08908..1d0be10d9 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -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