]> git.mxchange.org Git - friendica.git/commitdiff
Remote items should be threaded now
authorDomovoy <domovoy@errlock.org>
Sun, 5 Aug 2012 11:30:51 +0000 (13:30 +0200)
committerDomovoy <domovoy@errlock.org>
Sun, 5 Aug 2012 11:30:51 +0000 (13:30 +0200)
include/items.php

index 3b09dfa688c518750079cdad64638516b61ef611..13e4897aac13859a07e13ee4628ca505c6613de1 100755 (executable)
@@ -925,6 +925,8 @@ function item_store($arr,$force_parent = false) {
        $arr['origin']        = ((x($arr,'origin'))        ? intval($arr['origin'])              : 0 );
        $arr['guid']          = ((x($arr,'guid'))          ? notags(trim($arr['guid']))          : get_guid());
 
+
+       $arr['thr-parent'] = $arr['parent-uri'];
        if($arr['parent-uri'] === $arr['uri']) {
                $parent_id = 0;
                $parent_deleted = 0;
@@ -950,7 +952,6 @@ function item_store($arr,$force_parent = false) {
                        // and re-attach to the conversation parent.
 
                        if($r[0]['uri'] != $r[0]['parent-uri']) {
-                               $arr['thr-parent'] = $arr['parent-uri'];
                                $arr['parent-uri'] = $r[0]['parent-uri'];
                                $z = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `parent-uri` = '%s' AND `uid` = %d 
                                        ORDER BY `id` ASC LIMIT 1",
@@ -992,7 +993,6 @@ function item_store($arr,$force_parent = false) {
                        if($force_parent) {
                                logger('item_store: $force_parent=true, reply converted to top-level post.');
                                $parent_id = 0;
-                               $arr['thr-parent'] = $arr['parent-uri'];
                                $arr['parent-uri'] = $arr['uri'];
                                $arr['gravity'] = 0;
                        }