]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: Only send a notifier when the item was really edited
authorMichael <heluecht@pirati.ca>
Thu, 17 May 2018 05:49:55 +0000 (05:49 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 17 May 2018 05:49:55 +0000 (05:49 +0000)
src/Model/Item.php
src/Protocol/DFRN.php
src/Worker/Notifier.php

index fb3e59eb259e0f267cfa1470abdfa164378e59ff..0a480d755bdf224997f23aca92a9d84025e4f920 100644 (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']);
                        }
                }
index 51ec9ade9be81e72444d2925cb3880b9e960ac11..5efcfb80b5763365c905f9a973b8c00addacbf90 100644 (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;
        }
index 5d7c44591303ba844b64435684534827ccda3813..e22e8a1cd1b9521609f118bb79e93521ad31718d 100644 (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);