]> git.wh0rd.org Git - tt-rss.git/commitdiff
do not mark post as updated when comments count changes
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 27 Apr 2011 05:55:05 +0000 (09:55 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 27 Apr 2011 05:55:05 +0000 (09:55 +0400)
functions.php

index 79318dc68023e8cea768e9e71a7683319c884176..fc50bd46ea341c72fdaefe501b5b2867c1affa89 100644 (file)
                                        }
 
                                        $post_needs_update = false;
+                                       $update_insignificant = false;
 
                                        if ($content_hash != $orig_content_hash) {
 //                                             print "<!-- [$entry_title] $content_hash vs $orig_content_hash -->";
 
                                        if ($orig_num_comments != $num_comments) {
                                                $post_needs_update = true;
+                                               $update_insignificant = true;
                                        }
 
 //                                     this doesn't seem to be very reliable
                                                                num_comments = '$num_comments'
                                                        WHERE id = '$ref_id'");
 
-                                               if ($mark_unread_on_update) {
-                                                       db_query($link, "UPDATE ttrss_user_entries
-                                                               SET last_read = null, unread = true WHERE ref_id = '$ref_id'");
-                                               } else if ($update_on_checksum_change) {
-                                                       db_query($link, "UPDATE ttrss_user_entries
-                                                               SET last_read = null WHERE ref_id = '$ref_id' AND unread = false");
+                                               if (!$update_insignificant) {
+                                                       if ($mark_unread_on_update) {
+                                                               db_query($link, "UPDATE ttrss_user_entries
+                                                                       SET last_read = null, unread = true WHERE ref_id = '$ref_id'");
+                                                       } else if ($update_on_checksum_change) {
+                                                               db_query($link, "UPDATE ttrss_user_entries
+                                                                       SET last_read = null WHERE ref_id = '$ref_id'
+                                                                               AND unread = false");
+                                                       }
                                                }
-
                                        }
                                }