]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Circle.php
Drop using the proxy large size for image preview
[friendica.git] / src / Model / Circle.php
index 2233b58b0cf93df7fb5945f72b268dc05b466e70..92e3ea656010a6fed2c439a1e87c1929a467864f 100644 (file)
@@ -169,16 +169,17 @@ class Circle
         *
         * Count unread items of each circle of the local user
         *
+        * @param int $uid
         * @return array
         *    'id' => circle id
         *    'name' => circle name
         *    'count' => counted unseen circle items
         * @throws \Exception
         */
-       public static function countUnseen()
+       public static function countUnseen(int $uid)
        {
                $stmt = DBA::p("SELECT `circle`.`id`, `circle`.`name`,
-                               (SELECT COUNT(*) FROM `post-user-view`
+                               (SELECT COUNT(*) FROM `post-user`
                                        WHERE `uid` = ?
                                        AND `unseen`
                                        AND `contact-id` IN
@@ -188,8 +189,8 @@ class Circle
                                        ) AS `count`
                                FROM `group` AS `circle`
                                WHERE `circle`.`uid` = ?;",
-                       DI::userSession()->getLocalUserId(),
-                       DI::userSession()->getLocalUserId()
+                       $uid,
+                       $uid
                );
 
                return DBA::toArray($stmt);
@@ -478,22 +479,6 @@ class Circle
                return $return;
        }
 
-       public static function getByUID(int $uid): array
-       {
-               $circles = [];
-       
-               $stmt = DBA::select('group', [], ['deleted' => false, 'uid' => $uid, 'cid' => null], ['order' => ['id']]);
-               while ($circle = DBA::fetch($stmt)) {
-                       $circles[] = [
-                               'id'   => $circle['id'],
-                               'name' => $circle['name'],
-                       ];
-               }
-               DBA::close($stmt);
-
-               return $circles;
-       }
-
        /**
         * Returns a templated circle selection list
         *