]> git.mxchange.org Git - friendica-addons.git/commitdiff
Move BBCode::toPlaintext to Item::getPlaintextPost
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 21 Apr 2018 08:12:50 +0000 (04:12 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 21 Apr 2018 08:28:02 +0000 (04:28 -0400)
buffer/buffer.php
statusnet/statusnet.php
twitter/twitter.php

index bb1d8482e5405d23a3b642bba7f74e8d3277a3f7..27e54f55d4ee9d7a2dd1758b8ff27bd7901f3ae2 100644 (file)
@@ -8,12 +8,12 @@
 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');
@@ -338,7 +338,7 @@ function buffer_send(App $a, &$b)
                                        $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
index ad2da3224d6a4ef8018fb12a644201fcabce3fdd..09254f7fda7e85d8eac0a3ffed859fb7f1434ba5 100644 (file)
@@ -550,7 +550,7 @@ function statusnet_post_hook(App $a, &$b)
                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"]))
@@ -709,7 +709,7 @@ function statusnet_prepare_body(App $a, &$b)
                        }
                }
 
-               $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")) {
index 5036f515eb517d8511d31e7bc417d3d6f836a5fd..c76ecf0cceec1efd3e809c18cad6abc1a69f3b2d 100644 (file)
@@ -532,7 +532,7 @@ function twitter_post_hook(App $a, &$b)
                $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"])) {
@@ -766,7 +766,7 @@ function twitter_prepare_body(App $a, &$b)
                        }
                }
 
-               $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")) {