X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=statusnet%2Fstatusnet.php;h=bb51e24ba6287bc2822a032ea0d4f8076cd44b43;hb=5ea82418d8bda7ac7d484f766571892e1719486d;hp=00ae3ec8b9813decf1694548309400388e93f46c;hpb=2ed38ad2934034a875eb215d2c6cb560b062b322;p=friendica-addons.git diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 00ae3ec8..bb51e24b 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -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; @@ -403,7 +402,7 @@ function statusnet_hook_fork(App $a, array &$b) if (DI::pConfig()->get($post['uid'], 'statusnet', 'import')) { // Don't fork if it isn't a reply to a GNU Social post - if (($post['parent'] != $post['id']) && !Item::exists(['id' => $post['parent'], 'network' => Protocol::STATUSNET])) { + if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::STATUSNET])) { Logger::log('No GNU Social parent found for item ' . $post['id']); $b['execute'] = false; return; @@ -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; } @@ -1098,7 +1099,7 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex $postarray['uri'] = $hostname . "::" . $content->id; - if (Item::exists(['extid' => $postarray['uri'], 'uid' => $uid])) { + if (Post::exists(['extid' => $postarray['uri'], 'uid' => $uid])) { return []; }