]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Worked in fermionic's comments (not count($r)).
[friendica.git] / include / api.php
index 7d230629b0dab4445e41a0d9de140c46f71fef3e..7517abb70c4e44853d200991902ec1c6b15ecafd 100644 (file)
@@ -74,7 +74,7 @@
                // process normal login request
 
                $r = q("SELECT * FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) 
-                       AND `password` = '%s' AND `blocked` = 0 AND `account_expired` = 0 AND `verified` = 1 LIMIT 1",
+                       AND `password` = '%s' AND `blocked` = 0 AND `account_expired` = 0 AND `account_removed` = 0 AND `verified` = 1 LIMIT 1",
                        dbesc(trim($user)),
                        dbesc(trim($user)),
                        dbesc($encrypted)
 
                $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. 
+       
+               $r = q("UPDATE `item` SET `unseen` = 0 
+                       WHERE `unseen` = 1 AND `uid` = %d",
+                       intval($user_info['uid'])
+               );
+
 
                $data = array('$statuses' => $ret);
                switch($type){