]> git.mxchange.org Git - friendica.git/blob - include/notifier.php
Replace lowercase operators
[friendica.git] / include / notifier.php
1 <?php
2
3 use Friendica\App;
4 use Friendica\Core\Config;
5
6 require_once 'include/queue_fn.php';
7 require_once 'include/html2plain.php';
8 require_once 'include/probe.php';
9 require_once 'include/diaspora.php';
10 require_once 'include/ostatus.php';
11 require_once 'include/salmon.php';
12
13 /*
14  * This file was at one time responsible for doing all deliveries, but this caused
15  * big problems when the process was killed or stalled during the delivery process.
16  * It now invokes separate queues that are delivering via delivery.php and pubsubpublish.php.
17  */
18
19 /*
20  * The notifier is typically called with:
21  *
22  *              proc_run(PRIORITY_HIGH, "include/notifier.php", COMMAND, ITEM_ID);
23  *
24  * where COMMAND is one of the following:
25  *
26  *              activity                                (in diaspora.php, dfrn_confirm.php, profiles.php)
27  *              comment-import                  (in diaspora.php, items.php)
28  *              comment-new                             (in item.php)
29  *              drop                                    (in diaspora.php, items.php, photos.php)
30  *              edit_post                               (in item.php)
31  *              event                                   (in events.php)
32  *              expire                                  (in items.php)
33  *              like                                    (in like.php, poke.php)
34  *              mail                                    (in message.php)
35  *              suggest                                 (in fsuggest.php)
36  *              tag                                             (in photos.php, poke.php, tagger.php)
37  *              tgroup                                  (in items.php)
38  *              wall-new                                (in photos.php, item.php)
39  *              removeme                                (in Contact.php)
40  *              relocate                                (in uimport.php)
41  *
42  * and ITEM_ID is the id of the item in the database that needs to be sent to others.
43  */
44
45
46 function notifier_run(&$argv, &$argc){
47         global $a;
48
49         require_once 'include/datetime.php';
50         require_once 'include/items.php';
51         require_once 'include/bbcode.php';
52         require_once 'include/email.php';
53
54         if ($argc < 3) {
55                 return;
56         }
57
58         // Inherit the priority
59         $queue = dba::select('workerqueue', array('priority'), array('pid' => getmypid()), array('limit' => 1));
60         if (dbm::is_result($queue)) {
61                 $priority = (int)$queue['priority'];
62                 logger('inherited priority: '.$priority);
63         } else {
64                 // Normally this shouldn't happen.
65                 $priority = PRIORITY_HIGH;
66                 logger('no inherited priority! Something is wrong.');
67         }
68
69         logger('notifier: invoked: ' . print_r($argv,true), LOGGER_DEBUG);
70
71         $cmd = $argv[1];
72
73         switch($cmd) {
74                 case 'mail':
75                 default:
76                         $item_id = intval($argv[2]);
77                         if (! $item_id) {
78                                 return;
79                         }
80                         break;
81         }
82
83         $expire = false;
84         $mail = false;
85         $fsuggest = false;
86         $relocate = false;
87         $top_level = false;
88         $recipients = array();
89         $url_recipients = array();
90
91         $normal_mode = true;
92
93         if ($cmd === 'mail') {
94                 $normal_mode = false;
95                 $mail = true;
96                 $message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
97                                 intval($item_id)
98                 );
99                 if (! count($message)) {
100                         return;
101                 }
102                 $uid = $message[0]['uid'];
103                 $recipients[] = $message[0]['contact-id'];
104                 $item = $message[0];
105
106         } elseif ($cmd === 'expire') {
107                 $normal_mode = false;
108                 $expire = true;
109                 $items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1
110                         AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP() - INTERVAL 10 MINUTE",
111                         intval($item_id)
112                 );
113                 $uid = $item_id;
114                 $item_id = 0;
115                 if (! count($items)) {
116                         return;
117                 }
118         } elseif ($cmd === 'suggest') {
119                 $normal_mode = false;
120                 $fsuggest = true;
121
122                 $suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1",
123                         intval($item_id)
124                 );
125                 if (! count($suggest)) {
126                         return;
127                 }
128                 $uid = $suggest[0]['uid'];
129                 $recipients[] = $suggest[0]['cid'];
130                 $item = $suggest[0];
131         } elseif ($cmd === 'removeme') {
132                 $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
133                                 `user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
134                                 `user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`, `user`.`guid`
135                         FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
136                                 WHERE `contact`.`uid` = %d AND `contact`.`self` LIMIT 1",
137                                 intval($item_id));
138                 if (!$r)
139                         return;
140
141                 $user = $r[0];
142
143                 $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($item_id));
144                 if (!$r)
145                         return;
146
147                 $self = $r[0];
148
149                 $r = q("SELECT * FROM `contact` WHERE NOT `self` AND `uid` = %d", intval($item_id));
150                 if (!$r) {
151                         return;
152                 }
153                 require_once 'include/Contact.php';
154                 foreach ($r as $contact) {
155                         terminate_friendship($user, $self, $contact);
156                 }
157                 return;
158         } elseif ($cmd === 'relocate') {
159                 $normal_mode = false;
160                 $relocate = true;
161                 $uid = $item_id;
162
163                 $recipients_relocate = q("SELECT * FROM contact WHERE uid = %d  AND self = 0 AND network = '%s'" , intval($uid), NETWORK_DFRN);
164         } else {
165                 // find ancestors
166                 $r = q("SELECT * FROM `item` WHERE `id` = %d AND visible = 1 AND moderated = 0 LIMIT 1",
167                         intval($item_id)
168                 );
169
170                 if ((! dbm::is_result($r)) || (! intval($r[0]['parent']))) {
171                         return;
172                 }
173
174                 $target_item = $r[0];
175                 $parent_id = intval($r[0]['parent']);
176                 $uid = $r[0]['uid'];
177                 $updated = $r[0]['edited'];
178
179                 $items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer`
180                         FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d AND visible = 1 AND moderated = 0 ORDER BY `id` ASC",
181                         intval($parent_id)
182                 );
183
184                 if (! count($items)) {
185                         return;
186                 }
187
188                 // avoid race condition with deleting entries
189
190                 if ($items[0]['deleted']) {
191                         foreach ($items as $item) {
192                                 $item['deleted'] = 1;
193                         }
194                 }
195
196                 if ((count($items) == 1) && ($items[0]['id'] === $target_item['id']) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
197                         logger('notifier: top level post');
198                         $top_level = true;
199                 }
200
201         }
202
203         $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
204                 `user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
205                 `user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`
206                 FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
207                 WHERE `contact`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
208                 intval($uid)
209         );
210
211         if (! dbm::is_result($r)) {
212                 return;
213         }
214
215         $owner = $r[0];
216
217         $walltowall = ((($top_level) && ($owner['id'] != $items[0]['contact-id'])) ? true : false);
218
219         $hub = get_config('system','huburl');
220
221         // Should the post be transmitted to Diaspora?
222         $diaspora_delivery = true;
223
224         // If this is a public conversation, notify the feed hub
225         $public_message = true;
226
227         // Do a PuSH
228         $push_notify = false;
229
230         // fill this in with a single salmon slap if applicable
231         $slap = '';
232
233         if (! ($mail || $fsuggest || $relocate)) {
234
235                 $slap = ostatus::salmon($target_item,$owner);
236
237                 require_once 'include/group.php';
238
239                 $parent = $items[0];
240
241                 $thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
242                         dbesc($target_item["thr-parent"]), intval($target_item["uid"]));
243
244                 logger('GUID: '.$target_item["guid"].': Parent is '.$parent['network'].'. Thread parent is '.$thr_parent[0]['network'], LOGGER_DEBUG);
245
246                 // This is IMPORTANT!!!!
247
248                 // We will only send a "notify owner to relay" or followup message if the referenced post
249                 // originated on our system by virtue of having our hostname somewhere
250                 // in the URI, AND it was a comment (not top_level) AND the parent originated elsewhere.
251
252                 // if $parent['wall'] == 1 we will already have the parent message in our array
253                 // and we will relay the whole lot.
254
255                 // expire sends an entire group of expire messages and cannot be forwarded.
256                 // However the conversation owner will be a part of the conversation and will
257                 // be notified during this run.
258                 // Other DFRN conversation members will be alerted during polled updates.
259
260
261
262                 // Diaspora members currently are not notified of expirations, and other networks have
263                 // either limited or no ability to process deletions. We should at least fix Diaspora
264                 // by stringing togther an array of retractions and sending them onward.
265
266
267                 $localhost = str_replace('www.','',$a->get_hostname());
268                 if (strpos($localhost,':')) {
269                         $localhost = substr($localhost,0,strpos($localhost,':'));
270                 }
271                 /**
272                  *
273                  * Be VERY CAREFUL if you make any changes to the following several lines. Seemingly innocuous changes
274                  * have been known to cause runaway conditions which affected several servers, along with
275                  * permissions issues.
276                  *
277                  */
278
279                 $relay_to_owner = false;
280
281                 if (!$top_level && ($parent['wall'] == 0) && !$expire && (stristr($target_item['uri'],$localhost))) {
282                         $relay_to_owner = true;
283                 }
284
285
286                 if (($cmd === 'uplink') && (intval($parent['forum_mode']) == 1) && !$top_level) {
287                         $relay_to_owner = true;
288                 }
289
290                 // until the 'origin' flag has been in use for several months
291                 // we will just use it as a fallback test
292                 // later we will be able to use it as the primary test of whether or not to relay.
293
294                 if (! $target_item['origin']) {
295                         $relay_to_owner = false;
296                 }
297                 if ($parent['origin']) {
298                         $relay_to_owner = false;
299                 }
300                 if ($relay_to_owner) {
301                         logger('notifier: followup '.$target_item["guid"], LOGGER_DEBUG);
302                         // local followup to remote post
303                         $followup = true;
304                         $public_message = false; // not public
305                         $conversant_str = dbesc($parent['contact-id']);
306                         $recipients = array($parent['contact-id']);
307                         $recipients_followup  = array($parent['contact-id']);
308
309                         //if (!$target_item['private'] && $target_item['wall'] &&
310                         if (!$target_item['private'] &&
311                                 (strlen($target_item['allow_cid'].$target_item['allow_gid'].
312                                         $target_item['deny_cid'].$target_item['deny_gid']) == 0))
313                                 $push_notify = true;
314
315                         if (($thr_parent && ($thr_parent[0]['network'] == NETWORK_OSTATUS)) || ($parent['network'] == NETWORK_OSTATUS)) {
316
317                                 $push_notify = true;
318
319                                 if ($parent["network"] == NETWORK_OSTATUS) {
320                                         // Distribute the message to the DFRN contacts as if this wasn't a followup since OStatus can't relay comments
321                                         // Currently it is work at progress
322                                         $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s' AND NOT `blocked` AND NOT `pending` AND NOT `archive`",
323                                                 intval($uid),
324                                                 dbesc(NETWORK_DFRN)
325                                         );
326                                         if (dbm::is_result($r)) {
327                                                 foreach ($r as $rr) {
328                                                         $recipients_followup[] = $rr['id'];
329                                                 }
330                                         }
331                                 }
332                         }
333                         logger("Notify ".$target_item["guid"]." via PuSH: ".($push_notify?"Yes":"No"), LOGGER_DEBUG);
334                 } else {
335                         $followup = false;
336
337                         logger('Distributing directly '.$target_item["guid"], LOGGER_DEBUG);
338
339                         // don't send deletions onward for other people's stuff
340
341                         if ($target_item['deleted'] && (! intval($target_item['wall']))) {
342                                 logger('notifier: ignoring delete notification for non-wall item');
343                                 return;
344                         }
345
346                         if ((strlen($parent['allow_cid']))
347                                 || (strlen($parent['allow_gid']))
348                                 || (strlen($parent['deny_cid']))
349                                 || (strlen($parent['deny_gid']))) {
350                                 $public_message = false; // private recipients, not public
351                         }
352
353                         $allow_people = expand_acl($parent['allow_cid']);
354                         $allow_groups = expand_groups(expand_acl($parent['allow_gid']),true);
355                         $deny_people  = expand_acl($parent['deny_cid']);
356                         $deny_groups  = expand_groups(expand_acl($parent['deny_gid']));
357
358                         // if our parent is a public forum (forum_mode == 1), uplink to the origional author causing
359                         // a delivery fork. private groups (forum_mode == 2) do not uplink
360
361                         if ((intval($parent['forum_mode']) == 1) && (! $top_level) && ($cmd !== 'uplink')) {
362                                 proc_run($priority, 'include/notifier.php', 'uplink', $item_id);
363                         }
364
365                         $conversants = array();
366
367                         foreach ($items as $item) {
368                                 $recipients[] = $item['contact-id'];
369                                 $conversants[] = $item['contact-id'];
370                                 // pull out additional tagged people to notify (if public message)
371                                 if ($public_message && strlen($item['inform'])) {
372                                         $people = explode(',',$item['inform']);
373                                         foreach ($people as $person) {
374                                                 if (substr($person,0,4) === 'cid:') {
375                                                         $recipients[] = intval(substr($person,4));
376                                                         $conversants[] = intval(substr($person,4));
377                                                 } else {
378                                                         $url_recipients[] = substr($person,4);
379                                                 }
380                                         }
381                                 }
382                         }
383
384                         if (count($url_recipients))
385                                 logger('notifier: '.$target_item["guid"].' url_recipients ' . print_r($url_recipients,true));
386
387                         $conversants = array_unique($conversants);
388
389
390                         $recipients = array_unique(array_merge($recipients,$allow_people,$allow_groups));
391                         $deny = array_unique(array_merge($deny_people,$deny_groups));
392                         $recipients = array_diff($recipients,$deny);
393
394                         $conversant_str = dbesc(implode(', ',$conversants));
395                 }
396
397                 // If the thread parent is OStatus then do some magic to distribute the messages.
398                 // We have not only to look at the parent, since it could be a Friendica thread.
399                 if (($thr_parent && ($thr_parent[0]['network'] == NETWORK_OSTATUS)) || ($parent['network'] == NETWORK_OSTATUS)) {
400
401                         $diaspora_delivery = false;
402
403                         logger('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent[0]['author-link']." - Owner: ".$thr_parent[0]['owner-link'], LOGGER_DEBUG);
404
405                         // Send a salmon to the parent author
406                         $r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
407                                 dbesc(normalise_link($thr_parent[0]['author-link'])),
408                                 intval($uid));
409                         if (dbm::is_result($r)) {
410                                 $probed_contact = $r[0];
411                         } else {
412                                 $probed_contact = probe_url($thr_parent[0]['author-link']);
413                         }
414
415                         if ($probed_contact["notify"] != "") {
416                                 logger('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]);
417                                 $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
418                         }
419
420                         // Send a salmon to the parent owner
421                         $r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
422                                 dbesc(normalise_link($thr_parent[0]['owner-link'])),
423                                 intval($uid));
424                         if (dbm::is_result($r)) {
425                                 $probed_contact = $r[0];
426                         } else {
427                                 $probed_contact = probe_url($thr_parent[0]['owner-link']);
428                         }
429
430                         if ($probed_contact["notify"] != "") {
431                                 logger('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]);
432                                 $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
433                         }
434
435                         // Send a salmon notification to every person we mentioned in the post
436                         $arr = explode(',',$target_item['tag']);
437                         foreach ($arr as $x) {
438                                 //logger('Checking tag '.$x, LOGGER_DEBUG);
439                                 $matches = null;
440                                 if (preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) {
441                                                 $probed_contact = probe_url($matches[1]);
442                                         if ($probed_contact["notify"] != "") {
443                                                 logger('Notify mentioned user '.$probed_contact["url"].': '.$probed_contact["notify"]);
444                                                 $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
445                                         }
446                                 }
447                         }
448
449                         // It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora
450                         $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."')";
451                 } else {
452                         $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."', '".NETWORK_DIASPORA."', '".NETWORK_MAIL."', '".NETWORK_MAIL2."')";
453                 }
454         } else {
455                 $public_message = false;
456         }
457
458         // If this is a public message and pubmail is set on the parent, include all your email contacts
459
460         $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
461
462         if (! $mail_disabled) {
463                 if ((! strlen($target_item['allow_cid'])) && (! strlen($target_item['allow_gid']))
464                         && (! strlen($target_item['deny_cid'])) && (! strlen($target_item['deny_gid']))
465                         && (intval($target_item['pubmail']))) {
466                         $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s'",
467                                 intval($uid),
468                                 dbesc(NETWORK_MAIL)
469                         );
470                         if (dbm::is_result($r)) {
471                                 foreach ($r as $rr) {
472                                         $recipients[] = $rr['id'];
473                                 }
474                         }
475                 }
476         }
477
478         if ($followup) {
479                 $recip_str = implode(', ', $recipients_followup);
480         } else {
481                 $recip_str = implode(', ', $recipients);
482         }
483         if ($relocate) {
484                 $r = $recipients_relocate;
485         } else {
486                 $r = q("SELECT `id`, `url`, `network`, `self` FROM `contact`
487                         WHERE `id` IN (%s) AND NOT `blocked` AND NOT `pending` AND NOT `archive`".$sql_extra,
488                         dbesc($recip_str)
489                 );
490         }
491
492         // delivery loop
493
494         if (dbm::is_result($r)) {
495                 foreach ($r as $contact) {
496                         if ($contact['self']) {
497                                 continue;
498                         }
499                         logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG);
500
501                         proc_run(array('priority' => $priority, 'dont_fork' => true), 'include/delivery.php', $cmd, $item_id, $contact['id']);
502                 }
503         }
504
505         // send salmon slaps to mentioned remote tags (@foo@example.com) in OStatus posts
506         // They are especially used for notifications to OStatus users that don't follow us.
507
508         if ($slap && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) {
509                 if (!get_config('system','dfrn_only')) {
510                         foreach ($url_recipients as $url) {
511                                 if ($url) {
512                                         logger('notifier: urldelivery: ' . $url);
513                                         $deliver_status = slapper($owner,$url,$slap);
514                                         /// @TODO Redeliver/queue these items on failure, though there is no contact record
515                                 }
516                         }
517                 }
518         }
519
520
521         if ($public_message) {
522
523                 $r0 = array();
524                 $r1 = array();
525
526                 if ($diaspora_delivery) {
527                         if (!$followup) {
528                                 $r0 = Diaspora::relay_list();
529                         }
530
531                         $r1 = q("SELECT `batch`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`name`) AS `name`, ANY_VALUE(`network`) AS `network`
532                                 FROM `contact` WHERE `network` = '%s'
533                                 AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()",
534                                 dbesc(NETWORK_DIASPORA),
535                                 intval($owner['uid']),
536                                 intval(CONTACT_IS_SHARING)
537                         );
538                 }
539
540                 $r2 = q("SELECT `id`, `name`,`network` FROM `contact`
541                         WHERE `network` in ( '%s', '%s')  AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive`
542                         AND `rel` != %d order by rand() ",
543                         dbesc(NETWORK_DFRN),
544                         dbesc(NETWORK_MAIL2),
545                         intval($owner['uid']),
546                         intval(CONTACT_IS_SHARING)
547                 );
548
549                 $r = array_merge($r2,$r1,$r0);
550
551                 if (dbm::is_result($r)) {
552                         logger('pubdeliver '.$target_item["guid"].': '.print_r($r,true), LOGGER_DEBUG);
553
554                         foreach ($r as $rr) {
555
556                                 // except for Diaspora batch jobs
557                                 // Don't deliver to folks who have already been delivered to
558
559                                 if (($rr['network'] !== NETWORK_DIASPORA) && (in_array($rr['id'],$conversants))) {
560                                         logger('notifier: already delivered id=' . $rr['id']);
561                                         continue;
562                                 }
563
564                                 if ((! $mail) && (! $fsuggest) && (! $followup)) {
565                                         logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]);
566                                         proc_run(array('priority' => $priority, 'dont_fork' => true), 'include/delivery.php', $cmd, $item_id, $rr['id']);
567                                 }
568                         }
569                 }
570
571                 $push_notify = true;
572
573         }
574
575         // Notify PuSH subscribers (Used for OStatus distribution of regular posts)
576         if ($push_notify && strlen($hub)) {
577                 $hubs = explode(',', $hub);
578                 if (count($hubs)) {
579                         foreach ($hubs as $h) {
580                                 $h = trim($h);
581                                 if (! strlen($h)) {
582                                         continue;
583                                 }
584
585                                 if ($h === '[internal]') {
586                                         // Set push flag for PuSH subscribers to this topic,
587                                         // they will be notified in queue.php
588                                         q("UPDATE `push_subscriber` SET `push` = 1 ".
589                                           "WHERE `nickname` = '%s' AND `push` = 0", dbesc($owner['nickname']));
590
591                                         logger('Activating internal PuSH for item '.$item_id, LOGGER_DEBUG);
592
593                                 } else {
594
595                                         $params = 'hub.mode=publish&hub.url=' . urlencode( App::get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
596                                         post_url($h,$params);
597                                         logger('publish for item '.$item_id.' ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
598                                 }
599                                 if (count($hubs) > 1) {
600                                         sleep(7);                               // try and avoid multiple hubs responding at precisely the same time
601                                 }
602                         }
603                 }
604
605                 // Handling the pubsubhubbub requests
606                 proc_run(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), 'include/pubsubpublish.php');
607         }
608
609         logger('notifier: calling hooks', LOGGER_DEBUG);
610
611         if ($normal_mode) {
612                 call_hooks('notifier_normal',$target_item);
613         }
614
615         call_hooks('notifier_end',$target_item);
616
617         return;
618 }