From da2349bb6a85d13f0aa29046bef3021cf0c884ba Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 12 Feb 2015 17:45:25 -0800 Subject: provide relief to sites that are severely impacted by the slow ITEM_UNSEEN searches. This does not incorporate any other flag optimisations as that will require a major DB update and possibly involve significant downtime. This is just to bite off a little chunk now and provide some much needed relief. --- mod/item.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod/item.php') diff --git a/mod/item.php b/mod/item.php index ef0491895..99d28400b 100644 --- a/mod/item.php +++ b/mod/item.php @@ -643,8 +643,7 @@ function item_post(&$a) { } } - if(local_channel() != $profile_uid) - $item_flags |= ITEM_UNSEEN; + $item_unseen = ((local_channel() != $profile_uid) ? 1 : 0); if($post_type === 'wall' || $post_type === 'wall-comment') $item_flags = $item_flags | ITEM_WALL; @@ -694,7 +693,7 @@ function item_post(&$a) { $datarray['aid'] = $channel['channel_account_id']; $datarray['uid'] = $profile_uid; - + $datarray['owner_xchan'] = (($owner_hash) ? $owner_hash : $owner_xchan['xchan_hash']); $datarray['author_xchan'] = $observer['xchan_hash']; $datarray['created'] = $created; @@ -729,6 +728,7 @@ function item_post(&$a) { $datarray['term'] = $post_tags; $datarray['plink'] = $plink; $datarray['route'] = $route; + $datarray['item_unseen'] = $item_unseen; // preview mode - prepare the body for display and send it via json -- cgit v1.2.3