X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fitems.php;h=45d25e379f84713931de7ba41653b6a2c826a681;hb=d55275f211f5e03f7dc60e2c460aa9d3d34f44d9;hp=2feab3ea18e8bd2d4c99a1d9d6c5155bd77438cd;hpb=6fbb02fb93ffe8a004a27267cb05e8b9ba24038b;p=friendica.git diff --git a/include/items.php b/include/items.php index 2feab3ea18..45d25e379f 100644 --- a/include/items.php +++ b/include/items.php @@ -41,7 +41,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0, // default permissions - anonymous user - $sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' "; + $sql_extra = " AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' "; $r = q("SELECT `contact`.*, `user`.`uid` AS `user_uid`, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags` FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid` @@ -121,9 +121,10 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0, // Include answers to status.net posts in pubsub feeds if($forpubsub) { - $sql_post_table = "INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent` "; - $visibility = sprintf("AND (`item`.`parent` = `item`.`id`) OR (`item`.`network` = '%s' AND `thread`.`network`='%s')", - dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS)); + $sql_post_table = "INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent` + LEFT JOIN `item` AS `thritem` ON `thritem`.`uri`=`item`.`thr-parent` AND `thritem`.`uid`=`item`.`uid`"; + $visibility = sprintf("AND (`item`.`parent` = `item`.`id`) OR (`item`.`network` = '%s' AND ((`thread`.`network`='%s') OR (`thritem`.`network` = '%s')))", + dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_OSTATUS)); $date_field = "`received`"; $sql_order = "`item`.`received` DESC"; } else { @@ -1987,12 +1988,8 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { $rino = get_config('system','rino_encrypt'); - - if(! $rino) { - $rino = 0; - } else { - $rino = 2; - } + $rino = intval($rino); + @@ -2104,6 +2101,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { if($page) $postvars['page'] = $page; + if($rino>0 && $rino_remote_version>0 && (! $dissolve)) { logger('rino version: '. $rino_remote_version); @@ -4405,8 +4403,9 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { $o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']); if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) { + $parent = q("SELECT `guid` FROM `item` WHERE `id` = %d", intval($item["parent"])); $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']); - $o .= '' . "\r\n"; + $o .= ''."\r\n"; } $htmlbody = $body; @@ -4414,7 +4413,6 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { if ($item['title'] != "") $htmlbody = "[b]".$item['title']."[/b]\n\n".$htmlbody; - //$htmlbody = bbcode(bb_remove_share_information($htmlbody), false, false, 7); $htmlbody = bbcode($htmlbody, false, false, 7); $o .= '' . xmlify($item['uri']) . '' . "\r\n"; @@ -4423,8 +4421,7 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { $o .= '' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '' . "\r\n"; $o .= '' . base64url_encode($body, true) . '' . "\r\n"; $o .= '' . xmlify((($type === 'html') ? $htmlbody : $body)) . '' . "\r\n"; - $o .= '' . "\r\n"; - + $o .= ''."\r\n"; $o .= ''."\r\n";