]> git.mxchange.org Git - friendica-addons.git/blobdiff - windowsphonepush/windowsphonepush.php
Now with changed messages.po
[friendica-addons.git] / windowsphonepush / windowsphonepush.php
index bc19033c1009eacc56c27d14e70d1797a631172b..3aaf1d3092e90434cf12eb25cd10bde10da3a8ae 100644 (file)
  *        sets the counter back
  *        count only unseen elements which are not type=activity (likes and dislikes not seen as new elements)
  */
+
 use Friendica\App;
+use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
 use Friendica\Core\Addon;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
@@ -87,7 +90,7 @@ function windowsphonepush_settings_post($a, $post)
 
        PConfig::set(local_user(), 'windowsphonepush', 'senditemtext', intval($_POST['windowsphonepush-senditemtext']));
 
-       info(t('WindowsPhonePush settings updated.') . EOL);
+       info(L10n::t('WindowsPhonePush settings updated.') . EOL);
 }
 
 /* Called from the Addon Setting form.
@@ -209,10 +212,8 @@ function windowsphonepush_cron()
                                                if (substr($body, 0, 4) == "[url") {
                                                        $body = "URL/Image ...";
                                                } else {
-                                                       require_once('include/bbcode.php');
-                                                       require_once("include/html2plain.php");
-                                                       $body = bbcode($body, false, false, 2, true);
-                                                       $body = html2plain($body, 0);
+                                                       $body = BBCode::convert($body, false, 2, true);
+                                                       $body = HTML::toPlaintext($body, 0);
                                                        $body = ((strlen($body) > 137) ? substr($body, 0, 137) . "..." : $body);
                                                }
                                        } else {