X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=diaspora%2Fdiaspora.php;h=04d3c7eca88d32efd30e5f743987a2402d12ce69;hb=87a392a3c793b1b9b781939b46cf4189f15fb881;hp=59b130d752e87e6a5ebbbfb3d5b72beeafeaa242;hpb=f8c162cbfb777793891f885e019eb8eae319dce1;p=friendica-addons.git diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 59b130d7..04d3c7ec 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -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); }