diff options
-rw-r--r-- | Zotlabs/Module/Cards.php | 2 | ||||
-rw-r--r-- | include/conversation.php | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php index c542cd6ff..33688cba0 100644 --- a/Zotlabs/Module/Cards.php +++ b/Zotlabs/Module/Cards.php @@ -159,7 +159,7 @@ class Cards extends \Zotlabs\Web\Controller { if($items) { xchan_query($items); $items = fetch_post_tags($items, true); - $items = conv_sort($items,'created'); + $items = conv_sort($items,'updated'); } else $items = []; diff --git a/include/conversation.php b/include/conversation.php index e0de6fdce..2448775af 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1461,6 +1461,8 @@ function conv_sort($arr, $order) { usort($parents,'sort_thr_created'); elseif(stristr($order,'commented')) usort($parents,'sort_thr_commented'); + elseif(stristr($order,'updated')) + usort($parents,'sort_thr_updated'); elseif(stristr($order,'ascending')) usort($parents,'sort_thr_created_rev'); @@ -1502,6 +1504,10 @@ function sort_thr_commented($a,$b) { return strcmp($b['commented'],$a['commented']); } +function sort_thr_updated($a,$b) { + return strcmp($b['updated'],$a['updated']); +} + function find_thread_parent_index($arr,$x) { foreach($arr as $k => $v) if($v['id'] == $x['parent']) |