]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
API: Improved the timeline. Several (disabled) tests with caching of photos.
[friendica.git] / include / api.php
index ab83d63be4c501eb93d3a8ab6a31ac7588b6fe36..0885a1434b19b773284f9b7d85b1a3d582e6c25f 100644 (file)
                                $in_reply_to_status_id = 0;
                        }
 
+                       // Workaround for ostatus messages where the title is identically to the body
+                       $statusbody = trim(html2plain(bbcode($item['body']), 0));
+                       $statustitle = trim($item['title']);
+
+                       if (($statustitle != '') and (strpos($statusbody, $statustitle) !== false))
+                               $statustext = trim($statusbody);
+                       else
+                               $statustext = trim($statustitle."\n\n".$statusbody);
+
                        $status = array(
-                               'text'          => trim($item['title']." \n".html2plain(bbcode($item['body']), 0)),
+                               'text'          => $statustext,
                                'truncated' => False,
                                'created_at'=> api_date($item['created']),
                                'in_reply_to_status_id' => $in_reply_to_status_id,
                                'geo' => '',
                                'favorited' => $item['starred'] ? true : false,
                                'user' =>  $status_user ,
-                               'statusnet_html'                => bbcode($item['body']),
-                               'statusnet_conversation_id'     => 0,
+                               'statusnet_html'                => trim(bbcode($item['body'])),
+                               'statusnet_conversation_id'     => $item['parent'],
                        );
 
                        // Seesmic doesn't like the following content