ItemContent is replaced

pull/1074/head
Michael 2021-01-30 23:14:05 +00:00
parent 749dac6e38
commit 61d95f5302
3 changed files with 6 additions and 8 deletions

View File

@ -9,13 +9,13 @@
require 'addon/buffer/bufferapp.php'; require 'addon/buffer/bufferapp.php';
use Friendica\App; use Friendica\App;
use Friendica\Content\Text\Plaintext;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\ItemContent;
use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -342,7 +342,7 @@ function buffer_send(App $a, array &$b)
$item = $b; $item = $b;
$post = ItemContent::getPlaintextPost($item, $limit, $includedlinks, $htmlmode); $post = Plaintext::getPost($item, $limit, $includedlinks, $htmlmode);
Logger::log("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), Logger::DEBUG); Logger::log("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), Logger::DEBUG);
// The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures // The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures

View File

@ -52,7 +52,6 @@ use Friendica\DI;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Group; use Friendica\Model\Group;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Model\ItemContent;
use Friendica\Model\Photo; use Friendica\Model\Photo;
use Friendica\Model\Post; use Friendica\Model\Post;
use Friendica\Model\User; use Friendica\Model\User;
@ -578,7 +577,7 @@ function statusnet_post_hook(App $a, &$b)
DI::pConfig()->set($b['uid'], 'statusnet', 'max_char', $max_char); DI::pConfig()->set($b['uid'], 'statusnet', 'max_char', $max_char);
$tempfile = ""; $tempfile = "";
$msgarr = ItemContent::getPlaintextPost($b, $max_char, true, 7); $msgarr = Plaintext::getPost($b, $max_char, true, 7);
$msg = $msgarr["text"]; $msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"])) if (($msg == "") && isset($msgarr["title"]))
@ -729,7 +728,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"]; $msg = $msgarr["text"];
if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) { if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {

View File

@ -81,7 +81,6 @@ use Friendica\Model\Contact;
use Friendica\Model\Conversation; use Friendica\Model\Conversation;
use Friendica\Model\Group; use Friendica\Model\Group;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Model\ItemContent;
use Friendica\Model\ItemURI; use Friendica\Model\ItemURI;
use Friendica\Model\Post; use Friendica\Model\Post;
use Friendica\Model\Tag; use Friendica\Model\Tag;
@ -666,7 +665,7 @@ function twitter_post_hook(App $a, array &$b)
$b['body'] = twitter_update_mentions($b['body']); $b['body'] = twitter_update_mentions($b['body']);
$msgarr = ItemContent::getPlaintextPost($b, $max_char, true, BBCode::TWITTER); $msgarr = Plaintext::getPost($b, $max_char, true, BBCode::TWITTER);
Logger::info('Got plaintext', ['id' => $b['id'], 'message' => $msgarr]); Logger::info('Got plaintext', ['id' => $b['id'], 'message' => $msgarr]);
$msg = $msgarr["text"]; $msg = $msgarr["text"];
@ -896,7 +895,7 @@ function twitter_prepare_body(App $a, array &$b)
} }
} }
$msgarr = ItemContent::getPlaintextPost($item, $max_char, true, BBCode::TWITTER); $msgarr = Plaintext::getPost($item, $max_char, true, BBCode::TWITTER);
$msg = $msgarr["text"]; $msg = $msgarr["text"];
if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) { if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {