Merge pull request #5071 from annando/fix-duplicated-posts

Bugfix: Only send a notifier when the item was really edited
This commit is contained in:
Tobias Diekershoff 2018-05-17 07:59:56 +02:00 committed by GitHub
commit ac67f3c154
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View file

@ -75,8 +75,9 @@ class Item extends BaseObject
Term::insertFromFileFieldByItemId($item['id']); Term::insertFromFileFieldByItemId($item['id']);
self::updateThread($item['id']); self::updateThread($item['id']);
// We only need to notfiy others when it is an original entry from us // We only need to notfiy others when it is an original entry from us.
if ($item['origin']) { // 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']); Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $item['id']);
} }
} }

View file

@ -2140,10 +2140,6 @@ class DFRN
Item::update($fields, $condition); Item::update($fields, $condition);
$changed = true; $changed = true;
if ($entrytype == DFRN::REPLY_RC) {
Worker::add(PRIORITY_HIGH, "Notifier", "comment-import", $current["id"]);
}
} }
return $changed; return $changed;
} }

View file

@ -510,7 +510,7 @@ class Notifier {
'PubSubPublish'); 'PubSubPublish');
} }
logger('notifier: calling hooks', LOGGER_DEBUG); logger('notifier: calling hooks for ' . $cmd . ' ' . $item_id, LOGGER_DEBUG);
if ($normal_mode) { if ($normal_mode) {
Addon::forkHooks($a->queue['priority'], 'notifier_normal', $target_item); Addon::forkHooks($a->queue['priority'], 'notifier_normal', $target_item);