require 'addon/buffer/bufferapp.php';
use Friendica\App;
-use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\Plaintext;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Model\Item;
function buffer_install() {
Addon::registerHook('post_local', 'addon/buffer/buffer.php', 'buffer_post_local');
$item["body"] = preg_replace("(\[s\](.*?)\[\/s\])ism",'-$1-',$item["body"]);
}
- $post = BBCode::toPlaintext($item, $limit, $includedlinks, $htmlmode);
+ $post = Item::getPlaintextPost($item, $limit, $includedlinks, $htmlmode);
logger("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
PConfig::set($b['uid'], 'statusnet', 'max_char', $max_char);
$tempfile = "";
- $msgarr = BBCode::toPlaintext($b, $max_char, true, 7);
+ $msgarr = Item::getPlaintextPost($b, $max_char, true, 7);
$msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"]))
}
}
- $msgarr = BBCode::toPlaintext($item, $max_char, true, 7);
+ $msgarr = Item::getPlaintextPost($item, $max_char, true, 7);
$msg = $msgarr["text"];
if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
$connection->setTimeouts(10, 30);
$max_char = 280;
- $msgarr = BBCode::toPlaintext($b, $max_char, true, 8);
+ $msgarr = Item::getPlaintextPost($b, $max_char, true, 8);
$msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"])) {
}
}
- $msgarr = BBCode::toPlaintext($item, $max_char, true, 8);
+ $msgarr = Item::getPlaintextPost($item, $max_char, true, 8);
$msg = $msgarr["text"];
if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {