]> git.mxchange.org Git - friendica-addons.git/commitdiff
Method moved to Plaintext
authorAdam Magness <adam.magness@gmail.com>
Sat, 27 Jan 2018 01:30:38 +0000 (20:30 -0500)
committerAdam Magness <adam.magness@gmail.com>
Sat, 27 Jan 2018 01:30:38 +0000 (20:30 -0500)
the shorten method moved to Plaintext class

buffer/buffer.php
statusnet/statusnet.php
twitter/twitter.php

index a82fd4fc32174e3eefb1d6a55d1b596f43284496..0f05b5c6285434ead6bb703b4260d7d10cd0c0db 100644 (file)
@@ -9,6 +9,7 @@ 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;
@@ -365,8 +366,8 @@ function buffer_send(App $a, &$b)
                                if (($profile->service == "twitter") && isset($post["url"]) && ($post["type"] != "photo"))
                                        $post["text"] .= " ".$post["url"];
                                elseif (($profile->service == "appdotnet") && isset($post["url"]) && isset($post["title"]) && ($post["type"] != "photo")) {
-                                       $post["title"] = BBCode::shortenMsg($post["title"], 90);
-                                       $post["text"] = BBCode::shortenMsg($post["text"], $limit - (24 + strlen($post["title"])));
+                                       $post["title"] = Plaintext::shorten($post["title"], 90);
+                                       $post["text"] = Plaintext::shorten($post["text"], $limit - (24 + strlen($post["title"])));
                                        $post["text"] .= "\n[".$post["title"]."](".$post["url"].")";
                                } elseif (($profile->service == "appdotnet") && isset($post["url"]) && ($post["type"] != "photo"))
                                        $post["text"] .= " ".$post["url"];
index 40239af714463922547d7b7e524666192100f9dc..d74fd3134814147efa3d2fa17f29100304e2e135 100644 (file)
@@ -48,6 +48,7 @@ require_once 'include/enotify.php';
 use Friendica\App;
 use Friendica\Content\OEmbed;
 use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\Plaintext;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
@@ -645,7 +646,7 @@ function statusnet_post_hook(App $a, &$b)
                $msg = $msgarr["text"];
 
                if (($msg == "") && isset($msgarr["title"]))
-                       $msg = BBCode::shortenMsg($msgarr["title"], $max_char - 50);
+                       $msg = Plaintext::shorten($msgarr["title"], $max_char - 50);
 
                $image = "";
 
index 57a9db2b497686167d2929b2e10dcf801a6a7de4..6402b82d2a508fe748f84d3e0cb93460061cb2f9 100644 (file)
@@ -62,6 +62,7 @@
 use Friendica\App;
 use Friendica\Content\OEmbed;
 use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\Plaintext;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
@@ -529,7 +530,7 @@ function twitter_post_hook(App $a, &$b)
                $msg = $msgarr["text"];
 
                if (($msg == "") && isset($msgarr["title"])) {
-                       $msg = BBCode::shortenMsg($msgarr["title"], $max_char - 50);
+                       $msg = Plaintext::shorten($msgarr["title"], $max_char - 50);
                }
 
                $image = "";
@@ -597,7 +598,7 @@ function twitter_post_hook(App $a, &$b)
                        $msg = $msgarr["text"];
 
                        if (($msg == "") && isset($msgarr["title"])) {
-                               $msg = BBCode::shortenMsg($msgarr["title"], $max_char - 50);
+                               $msg = Plaintext::shorten($msgarr["title"], $max_char - 50);
                        }
 
                        if (isset($msgarr["url"])) {