From: Michael Date: Thu, 7 Nov 2019 07:09:46 +0000 (+0000) Subject: Pinned items are always at the top X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=463c9131b69537df86d41f1240046e0c552d0ccf;p=friendica.git Pinned items are always at the top --- diff --git a/include/conversation.php b/include/conversation.php index 84e47d34e3..54008fb5d4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1497,6 +1497,12 @@ function conv_sort(array $item_list, $order) */ function sort_thr_received(array $a, array $b) { + if ($b['pinned'] && !$a['pinned']) { + return 1; + } elseif (!$b['pinned'] && $a['pinned']) { + return -1; + } + return strcmp($b['received'], $a['received']); } @@ -1509,6 +1515,12 @@ function sort_thr_received(array $a, array $b) */ function sort_thr_received_rev(array $a, array $b) { + if ($b['pinned'] && !$a['pinned']) { + return -1; + } elseif (!$b['pinned'] && $a['pinned']) { + return 1; + } + return strcmp($a['received'], $b['received']); } @@ -1521,6 +1533,12 @@ 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']); }