return($entities);
}
-
+ function api_format_items_embeded_images($item, $text){
+ $a = get_app();
+ $text = preg_replace_callback(
+ "|data:image/([^;]+)[^=]+=*|m",
+ function($match) use ($a, $item) {
+ return $a->get_baseurl()."/display/".$item['guid'];
+ },
+ $text);
+ return $text;
+ }
+
function api_format_items($r,$user_info, $filter_user = false) {
$a = get_app();
if (($item["network"] == NETWORK_FEED) and (strlen($statustext)> 1000))
$statustext = substr($statustext, 0, 1000)."... \n".$item["plink"];
+ $statushtml = trim(bbcode($item['body'], false, false));
+
+ // handle data: images
+
+ $statustext = api_format_items_embeded_images($item,$statustext);
+
$status = array(
'text' => $statustext,
'truncated' => False,
//'attachments' => array(),
'user' => $status_user ,
//'entities' => NULL,
- 'statusnet_html' => trim(bbcode($item['body'], false, false)),
+ 'statusnet_html' => $statushtml,
'statusnet_conversation_id' => $item['parent'],
);
-
-
-
function api_share_as_retweet($a, $uid, &$item) {
$body = trim($item["body"]);