diff options
author | Friendika <info@friendika.com> | 2011-08-24 05:58:31 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-24 05:58:31 -0700 |
commit | d6f9e0e2a4864a7e7de48f40c8da676c870db6bc (patch) | |
tree | 334b5f2ce848b88f1bebb6ede428da977b6057bb /include/items.php | |
parent | a775474dff73e0e17e95bcfee42caeecdacf5295 (diff) | |
download | volse-hubzilla-d6f9e0e2a4864a7e7de48f40c8da676c870db6bc.tar.gz volse-hubzilla-d6f9e0e2a4864a7e7de48f40c8da676c870db6bc.tar.bz2 volse-hubzilla-d6f9e0e2a4864a7e7de48f40c8da676c870db6bc.zip |
change the way public feeds work just to fix statusnet's bug, because they won't
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php index 19e56c0b6..150be2707 100644 --- a/include/items.php +++ b/include/items.php @@ -12,6 +12,18 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) if(! strlen($owner_nick)) killme(); + $public_feed = (($dfrn_id) ? false : true); + $starred = false; + $converse = false; + + if($public_feed && $a->argc > 2) { + for($x = 2; $x < $a->argc; $x++) { + if($a->argv[$x] == 'converse') + $converse = true; + } + } + + $sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' "; $r = q("SELECT `contact`.*, `user`.`uid` AS `user_uid`, `user`.`nickname`, `user`.`timezone` @@ -29,7 +41,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) $birthday = feed_birthday($owner_id,$owner['timezone']); - if(strlen($dfrn_id)) { + if(! $public_feed) { $sql_extra = ''; switch($direction) { @@ -81,7 +93,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) ); } - if($dfrn_id === '' || $dfrn_id === '*') + if($public_feed) $sort = 'DESC'; else $sort = 'ASC'; @@ -89,6 +101,11 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) if(! strlen($last_update)) $last_update = 'now -30 days'; + if($public_feed) { + if(! $converse) + $sql_extra .= " AND `contact`.`self` = 1 "; + } + $check_date = datetime_convert('UTC','UTC',$last_update,'Y-m-d H:i:s'); $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, @@ -152,7 +169,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) // public feeds get html, our own nodes use bbcode - if($dfrn_id === '') { + if($public_feed) { $type = 'html'; // catch any email that's in a public conversation and make sure it doesn't leak if($item['private']) |