]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Merge https://github.com/friendica/friendica into pull
[friendica.git] / mod / item.php
index fddc3fd124aa3dd49acd989ad82889b9ba9b771c..6c1c06f99a901ea505dba9368252285ad821936e 100644 (file)
@@ -79,6 +79,7 @@ function item_post(&$a) {
                // if this isn't the real parent of the conversation, find it
                if($r !== false && count($r)) {
                        $parid = $r[0]['parent'];
+                       $parent_uri = $r[0]['uri'];
                        if($r[0]['id'] != $r[0]['parent']) {
                                $r = q("SELECT * FROM `item` WHERE `id` = `parent` AND `parent` = %d LIMIT 1",
                                        intval($parid)
@@ -96,7 +97,7 @@ function item_post(&$a) {
                $parent = $r[0]['id'];
 
                // multi-level threading - preserve the info but re-parent to our single level threading
-               if(($parid) && ($parid != $parent))
+               //if(($parid) && ($parid != $parent))
                        $thr_parent = $parent_uri;
 
                if($parent_item['contact-id'] && $uid) {
@@ -438,6 +439,7 @@ function item_post(&$a) {
 
        $body = bb_translate_video($body);
 
+
        /**
         * Fold multi-line [code] sequences
         */
@@ -446,6 +448,8 @@ function item_post(&$a) {
 
        $body = scale_external_images($body,false);
 
+
+
        /**
         * Look for any tags and linkify them
         */
@@ -541,6 +545,10 @@ function item_post(&$a) {
 
        $uri = item_new_uri($a->get_hostname(),$profile_uid);
 
+       // Fallback so that we alway have a thr-parent
+       if(!$thr_parent)
+               $thr_parent = $uri;
+
        $datarray = array();
        $datarray['uid']           = $profile_uid;
        $datarray['type']          = $post_type;
@@ -600,7 +608,7 @@ function item_post(&$a) {
 
        if($preview) {
                require_once('include/conversation.php');
-               $o = conversation($a,array(array_merge($contact_record,$datarray)),'search',false,true);
+               $o = conversation($a,array(array_merge($contact_record,$datarray)),'search', false);
                logger('preview: ' . $o);
                echo json_encode(array('preview' => $o));
                killme();
@@ -740,6 +748,7 @@ function item_post(&$a) {
                                        'verb'         => ACTIVITY_POST,
                                        'otype'        => 'item',
                                        'parent'       => $parent,
+                                       'parent_uri'   => $parent_item['uri']
                                ));
                        
                        }