Browse Source

Bugfix: Only send a notifier when the item was really edited

pull/5071/head
Michael 3 years ago
parent
commit
b333c7ae2e
3 changed files with 4 additions and 7 deletions
  1. +3
    -2
      src/Model/Item.php
  2. +0
    -4
      src/Protocol/DFRN.php
  3. +1
    -1
      src/Worker/Notifier.php

+ 3
- 2
src/Model/Item.php View File

@ -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']);
}
}


+ 0
- 4
src/Protocol/DFRN.php View File

@ -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;
}


+ 1
- 1
src/Worker/Notifier.php View File

@ -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);


Loading…
Cancel
Save