]> git.mxchange.org Git - friendica.git/commitdiff
Only update toplevel posts when ordered after posts
authorMichael <heluecht@pirati.ca>
Tue, 27 Feb 2018 23:25:29 +0000 (23:25 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 27 Feb 2018 23:25:29 +0000 (23:25 +0000)
mod/network.php

index 4ca518f903905a09b71634249e82f4313de24b84..5c69d9891ebc8d34e26675a7511f8717c67b042f 100644 (file)
@@ -760,14 +760,21 @@ function networkThreadedView(App $a, $update, $parent)
        // Fetch a page full of parent items for this page
        if ($update) {
                if (!empty($parent)) {
+                       // Load only a single thread
                        $sql_extra4 = "`item`.`id` = ".intval($parent);
                } else {
+                       // Load all unseen items
                        $sql_extra4 = "`item`.`unseen`";
                        if (Config::get("system", "like_no_comment")) {
                                $sql_extra4 .= " AND `item`.`verb` = '".ACTIVITY_POST."'";
                        }
                }
 
+               if ($order === 'post') {
+                       // Only show toplevel posts when updating posts in this order mode
+                       $sql_extra4 .= " AND `item`.`id` = `item`.`parent`";
+               }
+
                $r = q("SELECT `item`.`parent-uri` AS `uri`, `item`.`parent` AS `item_id`, $sql_order AS `order_date`
                        FROM `item` $sql_post_table
                        STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`