[twitter] Normalize mentions/foreign reshares #754

Merged
MrPetovan merged 3 commits from feature/3218-twitter-normalize-mentions into develop 2018-10-17 22:01:16 +02:00
Showing only changes of commit 4eff144765 - Show all commits

[twitter] Add support for $is_quote_share in twitter_convert_share

Hypolite Petovan 2018-10-17 08:19:47 -04:00

View file

@ -1891,7 +1891,7 @@ function twitter_update_mentions($body)
return $return;
}
function twitter_convert_share(array $attributes, array $author_contact, $content)
function twitter_convert_share(array $attributes, array $author_contact, $content, $is_quote_share)
{
if ($author_contact['network'] == Protocol::TWITTER) {
$mention = '@' . $author_contact['nickname'];
@ -1899,5 +1899,5 @@ function twitter_convert_share(array $attributes, array $author_contact, $conten
$mention = Protocol::formatMention($attributes['profile'], $attributes['author']);
}
return 'RT ' . $mention . ': ' . $content;
return ($is_quote_share ? "\n\n" : '' ) . 'RT ' . $mention . ': ' . $content . "\n\n" . $attributes['link'];
}