]> git.mxchange.org Git - friendica.git/commitdiff
The unseen marker is now set according to the query that is used for the home timeline.
authorMichael Vogel <icarus@dabo.de>
Fri, 3 Apr 2015 12:58:42 +0000 (14:58 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 3 Apr 2015 12:58:42 +0000 (14:58 +0200)
include/api.php

index 4d714e583f0d2fb395a47433fb353539c3d38b43..600cc0c3d60d54dad8169652966106c0c86ae1ad 100644 (file)
 
                $ret = api_format_items($r,$user_info);
 
-               // We aren't going to try to figure out at the item, group, and page
-               // level which items you've seen and which you haven't. If you're looking
-               // at the network timeline just mark everything seen.
+               // Set all posts from the query above to seen
+               $idarray = array();
+               foreach ($r AS $item)
+                       $idarray[] = intval($item["id"]);
 
-               $r = q("UPDATE `item` SET `unseen` = 0
-                       WHERE `unseen` = 1 AND `uid` = %d",
-                       //intval($user_info['uid'])
-                       intval(api_user())
-               );
+               $idlist = implode(",", $idarray);
+
+               $r = q("UPDATE `item` SET `unseen` = 0 WHERE `unseen` AND `id` IN (%s)", $idlist);
 
 
                $data = array('$statuses' => $ret);