]> git.mxchange.org Git - friendica.git/commitdiff
Issue 10433: Only notify when there had been changes
authorMichael <heluecht@pirati.ca>
Sat, 26 Jun 2021 11:29:58 +0000 (11:29 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 26 Jun 2021 11:29:58 +0000 (11:29 +0000)
src/Model/Item.php

index 5f1aaf3968811128de7ee27f326ca7e6aee1f919..26834c3a8bf20a75cd9e4be424891f015349e7a3 100644 (file)
@@ -159,6 +159,10 @@ class Item
                        $fields['vid'] = Verb::getID($fields['verb']);
                }
 
+               if (empty($fields['edited'])) {
+                       $previous = Post::selectFirst(['edited'], $condition);
+               }
+
                $rows = Post::update($fields, $condition);
                if (is_bool($rows)) {
                        return $rows;
@@ -203,8 +207,8 @@ class Item
                        }
 
                        // 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))) {
+                       // Only call the notifier when the item had been edited and records had been changed.
+                       if ($item['origin'] && !empty($fields['edited']) && ($previous['edited'] != $fields['edited'])) {
                                $notify_items[] = $item['id'];
                        }
                }