]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Check the edit date before storing history
[friendica.git] / src / Model / Item.php
index 496757910ae367a43a006b32513d1606fbdfd06c..a1cccb25444a32e871a61862831f0b0ca8b0e8a1 100644 (file)
@@ -725,7 +725,7 @@ class Item
                return GRAVITY_UNKNOWN;   // Should not happen
        }
 
-       public static function insert(array $item, bool $notify = false, bool $post_local = true)
+       public static function insert(array $item, int $notify = 0, bool $post_local = true)
        {
                $orig_item = $item;
 
@@ -739,7 +739,7 @@ class Item
                        $item['protocol'] = Conversation::PARCEL_DIRECT;
                        $item['direction'] = Conversation::PUSH;
 
-                       if (in_array($notify, PRIORITIES)) {
+                       if (is_int($notify) && in_array($notify, PRIORITIES)) {
                                $priority = $notify;
                        }
                } else {
@@ -1442,7 +1442,7 @@ class Item
                        return 0;
                }
 
-               if ((($item['gravity'] == GRAVITY_COMMENT) || $is_reshare) && !Post::exists(['uri-id' => $item['thr-parent-id'], 'uid' => $uid])) {
+               if (($uri_id != $item['thr-parent-id']) && (($item['gravity'] == GRAVITY_COMMENT) || $is_reshare) && !Post::exists(['uri-id' => $item['thr-parent-id'], 'uid' => $uid])) {
                        // Fetch the origin user for the post
                        $origin_uid = self::GetOriginUidForUriId($item['thr-parent-id'], $uid);
                        if (is_null($origin_uid)) {