mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
OStatus: Picture posts are reformatted
This commit is contained in:
parent
4798675e6e
commit
bb45112544
3 changed files with 18 additions and 4 deletions
|
@ -1089,6 +1089,17 @@ function xml_add_element($doc, $parent, $element, $value = "", $attributes = arr
|
|||
$parent->appendChild($element);
|
||||
}
|
||||
|
||||
function ostatus_format_picture_post($body) {
|
||||
$siteinfo = get_attached_data($body);
|
||||
|
||||
if (($siteinfo["type"] == "photo") AND isset($siteinfo["url"]) AND isset($siteinfo["preview"])) {
|
||||
$siteinfo["preview"] = str_replace(array("-1.jpg", "-1.png"), array("-2.jpg", "-2.png"), $siteinfo["preview"]);
|
||||
$body = trim($siteinfo["text"])." [url]".$siteinfo["url"]."[/url]\n[img]".$siteinfo["preview"]."[/img]";
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
function ostatus_add_header($doc, $owner) {
|
||||
$a = get_app();
|
||||
|
||||
|
@ -1332,6 +1343,8 @@ function ostatus_entry($doc, $item, $owner, $toplevel = false) {
|
|||
else
|
||||
$body = $item['body'];
|
||||
|
||||
$body = ostatus_format_picture_post($body);
|
||||
|
||||
if ($item['title'] != "")
|
||||
$body = "[b]".$item['title']."[/b]\n\n".$body;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue