X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fostatus.php;h=07eaec85d50f4b962a3b281507e84606ade94ce9;hb=eaf975faae1c36b1a7efdca95eb79e23a8228edd;hp=ce254ed61ad012328d362234882b6738c03c5cea;hpb=9c37fc320e11027477c0299a5541f377f4faa6c4;p=friendica.git diff --git a/include/ostatus.php b/include/ostatus.php index ce254ed61a..07eaec85d5 100644 --- a/include/ostatus.php +++ b/include/ostatus.php @@ -1201,6 +1201,14 @@ function ostatus_get_attachment($doc, $root, $item) { break; } + if (($siteinfo["type"] != "photo") AND isset($siteinfo["image"])) { + $photodata = get_photo_info($siteinfo["image"]); + + $attributes = array("rel" => "preview", "href" => $siteinfo["image"], "media:width" => $photodata[0], "media:height" => $photodata[1]); + xml_add_element($doc, $root, "link", "", $attributes); + } + + $arr = explode('[/attach],',$item['attach']); if(count($arr)) { foreach($arr as $r) { @@ -1229,7 +1237,7 @@ function ostatus_add_author($doc, $owner, $profile) { $author = $doc->createElement("author"); xml_add_element($doc, $author, "activity:object-type", ACTIVITY_OBJ_PERSON); xml_add_element($doc, $author, "uri", $owner["url"]); - xml_add_element($doc, $author, "name", $owner["nick"]); + xml_add_element($doc, $author, "name", $profile["name"]); $attributes = array("rel" => "alternate", "type" => "text/html", "href" => $owner["url"]); xml_add_element($doc, $author, "link", "", $attributes); @@ -1274,6 +1282,14 @@ function ostatus_add_author($doc, $owner, $profile) { return $author; } +/* +To-Do: Picture attachments should look like this: + +https://status.pirati.ca/attachment/572819 + +*/ + function ostatus_entry($doc, $item, $owner, $toplevel = false) { $a = get_app(); @@ -1327,6 +1343,7 @@ function ostatus_entry($doc, $item, $owner, $toplevel = false) { if ($item['title'] != "") $body = "[b]".$item['title']."[/b]\n\n".$body; + //$body = bb_remove_share_information($body); $body = bbcode($body, false, false, 7); xml_add_element($doc, $entry, "content", $body, array("type" => "html")); @@ -1440,7 +1457,7 @@ function ostatus_feed(&$a, $owner_nick, $last_update) { $root->appendChild($entry); } - return($doc->saveXML()); + return(trim($doc->saveXML())); } function ostatus_salmon($item,$owner) { @@ -1452,6 +1469,6 @@ function ostatus_salmon($item,$owner) { $doc->appendChild($entry); - return($doc->saveXML()); + return(trim($doc->saveXML())); } ?>