From 806e6a230e9667f19cdbed254adde97399a871aa Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 7 Nov 2019 07:41:54 +0000 Subject: [PATCH] Added description, removed sorting --- include/conversation.php | 6 ------ src/Model/Item.php | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index f6da5d858a..724d18dfea 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -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']); } diff --git a/src/Model/Item.php b/src/Model/Item.php index 98b058215d..dde33437a5 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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]); -- 2.39.5