X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItem.php;h=0a480d755bdf224997f23aca92a9d84025e4f920;hb=b333c7ae2ef38b54a837f3443b76cb02cedbbfd1;hp=dfb7ea065cfd4ac736198e69f4380f91877fadfa;hpb=82937189ba58b525a772ad56f0a963b27329058b;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index dfb7ea065c..0a480d755b 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -75,8 +75,9 @@ class Item extends BaseObject Term::insertFromFileFieldByItemId($item['id']); self::updateThread($item['id']); - // We only need to notfiy others when it is an original entry from us - if ($item['origin']) { + // We only need to notfiy others when it is an original entry from us. + // Only call the notifier when the item has some content relevant change. + if ($item['origin'] && in_array('edited', array_keys($fields))) { Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $item['id']); } } @@ -117,12 +118,12 @@ class Item extends BaseObject 'verb', 'object-type', 'object', 'target', 'contact-id']; $item = dba::selectFirst('item', $fields, ['id' => $item_id]); if (!DBM::is_result($item)) { - logger('Item with ID ' . $item_id . " hadn't been found.", LOGGER_DEBUG); + logger('Item with ID ' . $item_id . " hasn't been found.", LOGGER_DEBUG); return false; } if ($item['deleted']) { - logger('Item with ID ' . $item_id . ' is already deleted.', LOGGER_DEBUG); + logger('Item with ID ' . $item_id . ' has already been deleted.', LOGGER_DEBUG); return false; } @@ -202,7 +203,7 @@ class Item extends BaseObject Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", "drop", intval($item['id'])); } - logger('Item with ID ' . $item_id . " had been deleted.", LOGGER_DEBUG); + logger('Item with ID ' . $item_id . " has been deleted.", LOGGER_DEBUG); return true; } @@ -344,6 +345,12 @@ class Item extends BaseObject $item['origin'] = 1; $item['network'] = NETWORK_DFRN; $item['protocol'] = PROTOCOL_DFRN; + + if (is_int($notify)) { + $priority = $notify; + } else { + $priority = PRIORITY_HIGH; + } } else { $item['network'] = trim(defaults($item, 'network', NETWORK_PHANTOM)); } @@ -872,7 +879,7 @@ class Item extends BaseObject check_user_notification($current_post); if ($notify) { - Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "Notifier", $notify_type, $current_post); + Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", $notify_type, $current_post); } elseif (!empty($parent) && $parent['origin']) { Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "Notifier", "comment-import", $current_post); }