From e46eba125888704b4381aa8418495e91eeb565c8 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 22 Jan 2015 17:41:16 -0800 Subject: heavy lifting converting item flag bits --- mod/network.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 65332e3f6..5e583f657 100644 --- a/mod/network.php +++ b/mod/network.php @@ -154,12 +154,12 @@ function network_content(&$a, $update = 0, $load = false) { $sql_options = (($star) - ? " and (item_flags & " . intval(ITEM_STARRED) . ") > 0" + ? " and item_starred = 1 " : ''); $sql_nets = ''; - $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE (item_flags & " . intval(ITEM_THREAD_TOP) . ")>0 $sql_options ) "; + $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE item_thread_top = 1 $sql_options ) "; if($group) { $contact_str = ''; @@ -291,9 +291,8 @@ function network_content(&$a, $update = 0, $load = false) { } if($conv) { - $sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan like '%s' or ( item_flags & %d ) > 0)) ", - dbesc(protect_sprintf($channel['channel_hash'])), - intval(ITEM_MENTIONSME) + $sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan like '%s' or item_mentionsme = 1 )) ", + dbesc(protect_sprintf($channel['channel_hash'])) ); } @@ -346,7 +345,7 @@ function network_content(&$a, $update = 0, $load = false) { else $page_mode = 'client'; - $simple_update = (($update) ? " and ( item.item_flags & " . intval(ITEM_UNSEEN) . " ) > 0 " : ''); + $simple_update = (($update) ? " and item.item_unseen = 1 " : ''); // This fixes a very subtle bug so I'd better explain it. You wake up in the morning or return after a day // or three and look at your matrix page - after opening up your browser. The first page loads just as it @@ -465,10 +464,7 @@ function network_content(&$a, $update = 0, $load = false) { } if(($update_unseen) && (! $firehose)) - $r = q("UPDATE item SET item_flags = ( item_flags & ~%d) - WHERE (item_flags & %d) > 0 AND uid = %d $update_unseen ", - intval(ITEM_UNSEEN), - intval(ITEM_UNSEEN), + $r = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d $update_unseen ", intval(local_user()) ); -- cgit v1.2.3