Merge pull request #6774 from MrPetovan/bug/6501-fix-reshare-to-diaspora

Improve reshare format to Diaspora destinations
This commit is contained in:
Tobias Diekershoff 2019-02-28 07:02:27 +01:00 committed by GitHub
commit 3aad29358c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View file

@ -26,7 +26,7 @@ function share_init(App $a) {
$o = share_header($item['author-name'], $item['author-link'], $item['author-avatar'], $item['guid'], $item['created'], $item['plink']); $o = share_header($item['author-name'], $item['author-link'], $item['author-avatar'], $item['guid'], $item['created'], $item['plink']);
if ($item['title']) { if ($item['title']) {
$o .= '[b]'.$item['title'].'[/b]'."\n"; $o .= '[h3]'.$item['title'].'[/h3]'."\n";
} }
$o .= $item['body']; $o .= $item['body'];

View file

@ -950,15 +950,19 @@ class BBCode extends BaseObject
$text = ($is_quote_share? '<br />' : '') . '<p>' . html_entity_decode('&#x2672; ', ENT_QUOTES, 'UTF-8') . ' ' . $author_contact['addr'] . ': </p>' . "\n" . $content; $text = ($is_quote_share? '<br />' : '') . '<p>' . html_entity_decode('&#x2672; ', ENT_QUOTES, 'UTF-8') . ' ' . $author_contact['addr'] . ': </p>' . "\n" . $content;
break; break;
case 3: // Diaspora case 3: // Diaspora
$headline = '<p><b>' . html_entity_decode('&#x2672; ', ENT_QUOTES, 'UTF-8') . $mention . ':</b></p>' . "\n";
if (stripos(Strings::normaliseLink($attributes['link']), 'http://twitter.com/') === 0) { if (stripos(Strings::normaliseLink($attributes['link']), 'http://twitter.com/') === 0) {
$text = ($is_quote_share? '<hr />' : '') . '<p><a href="' . $attributes['link'] . '">' . $attributes['link'] . '</a></p>' . "\n"; $text = ($is_quote_share? '<hr />' : '') . '<p><a href="' . $attributes['link'] . '">' . $attributes['link'] . '</a></p>' . "\n";
} else { } else {
$headline = '<p><b>♲ <a href="' . $attributes['profile'] . '">' . $attributes['author'] . '</a>:</b></p>' . "\n";
if (!empty($attributes['posted']) && !empty($attributes['link'])) {
$headline = '<p><b>♲ <a href="' . $attributes['profile'] . '">' . $attributes['author'] . '</a></b> - <a href="' . $attributes['link'] . '">' . $attributes['posted'] . ' GMT</a></p>' . "\n";
}
$text = ($is_quote_share? '<hr />' : '') . $headline . '<blockquote>' . trim($content) . '</blockquote>' . "\n"; $text = ($is_quote_share? '<hr />' : '') . $headline . '<blockquote>' . trim($content) . '</blockquote>' . "\n";
if ($attributes['link'] != '') { if (empty($attributes['posted']) && !empty($attributes['link'])) {
$text .= '<p><a href="' . $attributes['link'] . '">[l]</a></p>' . "\n"; $text .= '<p><a href="' . $attributes['link'] . '">[Source]</a></p>' . "\n";
} }
} }