]> git.mxchange.org Git - friendica-addons.git/blobdiff - diaspora/diaspora.php
Merge pull request #634 from annando/language
[friendica-addons.git] / diaspora / diaspora.php
index 59b130d752e87e6a5ebbbfb3d5b72beeafeaa242..04d3c7eca88d32efd30e5f743987a2402d12ce69 100644 (file)
@@ -9,6 +9,7 @@
 
 require_once 'addon/diaspora/Diaspora_Connection.php';
 
+use Friendica\Content\Text\BBCode;
 use Friendica\Core\Addon;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
@@ -140,9 +141,9 @@ function diaspora_settings(&$a,&$s) {
 
        $r = q("SELECT `addr` FROM `contact` WHERE `self` AND `uid` = %d", intval(local_user()));
        if (DBM::is_result($r)) {
-               $status = sprintf(L10n::t("Please remember: You can always be reached from Diaspora with your Friendica handle %s. "), $r[0]['addr']);
+               $status = L10n::t("Please remember: You can always be reached from Diaspora with your Friendica handle %s. ", $r[0]['addr']);
                $status .= L10n::t('This connector is only meant if you still want to use your old Diaspora account for some time. ');
-               $status .= sprintf(L10n::t('However, it is preferred that you tell your Diaspora contacts the new handle %s instead.'), $r[0]['addr']);
+               $status .= L10n::t('However, it is preferred that you tell your Diaspora contacts the new handle %s instead.', $r[0]['addr']);
        }
 
        $aspects = false;
@@ -303,10 +304,8 @@ function diaspora_send(&$a,&$b) {
        $aspect = PConfig::get($b['uid'],'diaspora','aspect');
 
        if ($handle && $password) {
-
                logger('diaspora_send: all values seem to be okay', LOGGER_DEBUG);
 
-               require_once('include/bb2diaspora.php');
                $tag_arr = [];
                $tags = '';
                $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER);
@@ -338,7 +337,7 @@ function diaspora_send(&$a,&$b) {
                 } while ($oldbody != $body);
 
                // convert to markdown
-               $body = bb2diaspora($body, false, true);
+               $body = BBCode::toMarkdown($body);
 
                // Adding the title
                if(strlen($title))
@@ -367,7 +366,7 @@ function diaspora_send(&$a,&$b) {
                                $a->contact = $r[0]["id"];
 
                        $s = serialize(['url' => $url, 'item' => $b['id'], 'post' => $body]);
-                       
+
                        Queue::add($a->contact, NETWORK_DIASPORA2, $s);
                        notice(L10n::t('Diaspora post failed. Queued for retry.').EOL);
                }