From b333c7ae2ef38b54a837f3443b76cb02cedbbfd1 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 17 May 2018 05:49:55 +0000 Subject: [PATCH] Bugfix: Only send a notifier when the item was really edited --- src/Model/Item.php | 5 +++-- src/Protocol/DFRN.php | 4 ---- src/Worker/Notifier.php | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index fb3e59eb25..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']); } } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 51ec9ade9b..5efcfb80b5 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2140,10 +2140,6 @@ class DFRN Item::update($fields, $condition); $changed = true; - - if ($entrytype == DFRN::REPLY_RC) { - Worker::add(PRIORITY_HIGH, "Notifier", "comment-import", $current["id"]); - } } return $changed; } diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 5d7c445913..e22e8a1cd1 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -510,7 +510,7 @@ class Notifier { 'PubSubPublish'); } - logger('notifier: calling hooks', LOGGER_DEBUG); + logger('notifier: calling hooks for ' . $cmd . ' ' . $item_id, LOGGER_DEBUG); if ($normal_mode) { Addon::forkHooks($a->queue['priority'], 'notifier_normal', $target_item); -- 2.39.5