]> git.mxchange.org Git - friendica.git/commitdiff
Some small improvements to the OStatus export
authorMichael Vogel <icarus@dabo.de>
Fri, 27 Nov 2015 22:16:54 +0000 (23:16 +0100)
committerMichael Vogel <icarus@dabo.de>
Fri, 27 Nov 2015 22:16:54 +0000 (23:16 +0100)
include/bbcode.php
include/items.php
include/ostatus.php

index 81536d37200fdd5083a38685c306282856f8d0cb..e07b63313a5cb28c607545a14009a9e49e6d770e 100644 (file)
@@ -100,7 +100,7 @@ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) {
                        }
 
                        if ($simplehtml == 7)
-                               $text = sprintf('<a href="%s" title="%s" class="attachment thumbnail" rel="nofollow external">%s</a>',
+                               $text = sprintf('<a href="%s" title="%s" class="attachment thumbnail" rel="nofollow external">%s</a><br />',
                                                $url, $title, $title);
                        elseif (($simplehtml != 4) AND ($simplehtml != 0))
                                $text = sprintf('<a href="%s" target="_blank">%s</a><br>', $url, $title);
index 53f4784c2d053fe06661a979d4ffdca507d71937..f86c6453f62f7405e85910190d1b92d7f5b6b478 100644 (file)
@@ -4645,7 +4645,7 @@ function item_getfeedtags($item) {
        if($cnt) {
                for($x = 0; $x < $cnt; $x ++) {
                        if($matches[1][$x])
-                               $ret[] = array('#',$matches[1][$x], $matches[2][$x]);
+                               $ret[$matches[2][$x]] = array('#',$matches[1][$x], $matches[2][$x]);
                }
        }
        $matches = false;
index ce254ed61ad012328d362234882b6738c03c5cea..2c6480fd3281b2145faa51691fbe1077c8b32477 100644 (file)
@@ -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) {
@@ -1327,6 +1335,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 +1449,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 +1461,6 @@ function ostatus_salmon($item,$owner) {
 
        $doc->appendChild($entry);
 
-       return($doc->saveXML());
+       return(trim($doc->saveXML()));
 }
 ?>