diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2011-08-26 14:44:24 +0200 |
---|---|---|
committer | fabrixxm <fabrix.xm@gmail.com> | 2011-08-26 14:44:24 +0200 |
commit | 5ec4a4e6deb5d28cbfab54093f8b4180912738d4 (patch) | |
tree | 653cb4738734d9f20bd1457c419105dcf235edea /include/items.php | |
parent | 97806544bcd7ee3831ffc515062afe0812828b76 (diff) | |
parent | 1861dc1fae549a0ee2b6287d4f7dc7f8797f5070 (diff) | |
download | volse-hubzilla-5ec4a4e6deb5d28cbfab54093f8b4180912738d4.tar.gz volse-hubzilla-5ec4a4e6deb5d28cbfab54093f8b4180912738d4.tar.bz2 volse-hubzilla-5ec4a4e6deb5d28cbfab54093f8b4180912738d4.zip |
Merge remote-tracking branch 'friendika/master' into newui
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php index 746e3b294..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']) @@ -1556,7 +1573,7 @@ function subscribe_to_hub($url,$importer,$contact) { intval($importer['uid']) ); } - if(! count($r)) + if((! count($r)) || $contact['network'] === NETWORK_DIASPORA) return; $push_url = get_config('system','url') . '/pubsub/' . $r[0]['nickname'] . '/' . $contact['id']; |