]> git.mxchange.org Git - friendica.git/commitdiff
Added description, removed sorting
authorMichael <heluecht@pirati.ca>
Thu, 7 Nov 2019 07:41:54 +0000 (07:41 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 7 Nov 2019 07:41:54 +0000 (07:41 +0000)
include/conversation.php
src/Model/Item.php

index f6da5d858a963e3ade605ab3a8622988542ddcf3..724d18dfeab9a08265d772837e9e03fddfe220db 100644 (file)
@@ -1541,12 +1541,6 @@ function sort_thr_received_rev(array $a, array $b)
  */
 function sort_thr_commented(array $a, array $b)
 {
-       if ($b['pinned'] && !$a['pinned']) {
-               return 1;
-       } elseif (!$b['pinned'] && $a['pinned']) {
-               return -1;
-       }
-
        return strcmp($b['commented'], $a['commented']);
 }
 
index 98b058215de89bdf649f18bc8eb521a4785d8e72..dde33437a506ab998ae3796f73abbf743c6f2fa9 100644 (file)
@@ -143,6 +143,15 @@ class Item extends BaseObject
                return (bool)$useritem['pinned'];
        }
 
+       /**
+        * @brief Select pinned rows from the item table for a given user
+        *
+        * @param integer $uid       User ID
+        * @param array   $selected  Array of selected fields, empty for all
+        *
+        * @return boolean|object
+        * @throws \Exception
+        */
        public static function selectPinned(int $uid, array $selected = [])
        {
                $useritems = DBA::select('user-item', ['iid'], ['uid' => $uid, 'pinned' => true]);