diff options
Diffstat (limited to 'Zotlabs/Widget/Messages.php')
-rw-r--r-- | Zotlabs/Widget/Messages.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index 0f57a8d85..9a3f0fa9c 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -58,7 +58,8 @@ class Messages { } $channel = App::get_channel(); - $item_normal = str_replace('item.', 'i.', item_normal()); + $item_normal_i = str_replace('item.', 'i.', item_normal()); + $item_normal_c = str_replace('item.', 'c.', item_normal()); $entries = []; $limit = 30; $dummy_order_sql = ''; @@ -89,12 +90,12 @@ class Messages { } $items = q("SELECT *, - (SELECT count(*) FROM item c WHERE c.uid = %d AND c.parent = i.parent AND c.item_unseen = 1 AND c.item_thread_top = 0 $vnotify_sql) AS unseen_count + (SELECT count(*) FROM item c WHERE c.uid = %d AND c.parent = i.parent AND c.item_unseen = 1 AND c.item_thread_top = 0 $item_normal_c $vnotify_sql) AS unseen_count FROM item i WHERE i.uid = %d AND i.created <= '%s' $type_sql AND i.item_thread_top = 1 - $item_normal + $item_normal_i ORDER BY i.created DESC $dummy_order_sql LIMIT $limit OFFSET $offset", intval(local_channel()), |