]> git.mxchange.org Git - friendica.git/blobdiff - include/notifier.php
Merge https://github.com/friendica/friendica into pull
[friendica.git] / include / notifier.php
index fe6cc394ed9b3cab191c5e437ff009670a0da741..947818d597718e0ecc3f0346c938483a31177233 100644 (file)
@@ -18,6 +18,31 @@ require_once('include/html2plain.php');
  * us by hosting providers. 
  */
 
+/*
+ * The notifier is typically called with:
+ *
+ *             proc_run('php', "include/notifier.php", COMMAND, ITEM_ID);
+ *
+ * where COMMAND is one of the following:
+ *
+ *             activity                                (in diaspora.php, dfrn_confirm.php, profiles.php)
+ *             comment-import                  (in diaspora.php, items.php)
+ *             comment-new                             (in item.php)
+ *             drop                                    (in diaspora.php, items.php, photos.php)
+ *             edit_post                               (in item.php)
+ *             event                                   (in events.php)
+ *             expire                                  (in items.php)
+ *             like                                    (in like.php, poke.php)
+ *             mail                                    (in message.php)
+ *             suggest                                 (in fsuggest.php)
+ *             tag                                             (in photos.php, poke.php, tagger.php)
+ *             tgroup                                  (in items.php)
+ *             wall-new                                (in photos.php, item.php)
+ *
+ * and ITEM_ID is the id of the item in the database that needs to be sent to others.
+ */
+
+
 function notifier_run($argv, $argc){
        global $a, $db;
 
@@ -125,7 +150,7 @@ function notifier_run($argv, $argc){
                $uid = $r[0]['uid'];
                $updated = $r[0]['edited'];
 
-               // The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up
+               // POSSIBLE CLEANUP --> The following seems superfluous. We've already checked for "if (! intval($r[0]['parent']))" a few lines up
                if(! $parent_id)
                        return;
 
@@ -399,7 +424,7 @@ function notifier_run($argv, $argc){
 
                                // private emails may be in included in public conversations. Filter them.
 
-                               if(($public_message) && $item['private'])
+                               if(($public_message) && $item['private'] == 1)
                                        continue;
 
 
@@ -709,11 +734,11 @@ function notifier_run($argv, $argc){
                                        }
                                        break;
                                case NETWORK_DIASPORA:
+                                       require_once('include/diaspora.php');
+
                                        if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')))
                                                break;
 
-                                       require_once('include/diaspora.php');
-
                                        if($mail) {
                                                diaspora_send_mail($item,$owner,$contact);
                                                break;
@@ -860,17 +885,13 @@ function notifier_run($argv, $argc){
 
        }
 
-
-       // If the item was deleted, clean up the `sign` table (for Diaspora signatures)
-       // Do this even if Diaspora support is disabled, as it may have been enabled in
-       // the past
+       // If the item was deleted, clean up the `sign` table
        if($target_item['deleted']) {
                $r = q("DELETE FROM sign where `retract_iid` = %d",
                        intval($target_item['id'])
                );
        }
 
-
        logger('notifier: calling hooks', LOGGER_DEBUG);
 
        if($normal_mode)