]> git.mxchange.org Git - friendica-addons.git/blobdiff - statusnet/statusnet.php
Update .drone.yml
[friendica-addons.git] / statusnet / statusnet.php
index 5d1e164ac75ca6638d6a598ee33be2539c18332e..bb51e24ba6287bc2822a032ea0d4f8076cd44b43 100644 (file)
@@ -52,7 +52,6 @@ use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Model\Item;
-use Friendica\Model\ItemContent;
 use Friendica\Model\Photo;
 use Friendica\Model\Post;
 use Friendica\Model\User;
@@ -482,6 +481,8 @@ function statusnet_post_hook(App $a, &$b)
                        return;
        }
 
+       $b['body'] = Post\Media::addAttachmentsToBody($b['uri-id'], $b['body']);
+
        $api = DI::pConfig()->get($b["uid"], 'statusnet', 'baseapi');
        $hostname = preg_replace("=https?://([\w\.]*)/.*=ism", "$1", $api);
 
@@ -578,7 +579,7 @@ function statusnet_post_hook(App $a, &$b)
                DI::pConfig()->set($b['uid'], 'statusnet', 'max_char', $max_char);
 
                $tempfile = "";
-               $msgarr = ItemContent::getPlaintextPost($b, $max_char, true, 7);
+               $msgarr = Plaintext::getPost($b, $max_char, true, 7);
                $msg = $msgarr["text"];
 
                if (($msg == "") && isset($msgarr["title"]))
@@ -729,7 +730,7 @@ function statusnet_prepare_body(App $a, &$b)
                        }
                }
 
-               $msgarr = ItemContent::getPlaintextPost($item, $max_char, true, 7);
+               $msgarr = Plaintext::getPost($item, $max_char, true, 7);
                $msg = $msgarr["text"];
 
                if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
@@ -877,7 +878,7 @@ function statusnet_fetchtimeline(App $a, $uid)
 
                                $_REQUEST["title"] = "";
 
-                               $_REQUEST["body"] = PageInfo::searchAndAppendToBody($post->text, true);
+                               $_REQUEST["body"] = $post->text;
                                if (is_string($post->place->name)) {
                                        $_REQUEST["location"] = $post->place->name;
                                }