]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Merge pull request #1683 from fabrixxm/issue-1655
[friendica.git] / include / items.php
index 2feab3ea18e8bd2d4c99a1d9d6c5155bd77438cd..475980d2dc972584aaef409cbf64134566b53c1a 100644 (file)
@@ -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);