[twitter] Use rich text for quote tweet
This commit is contained in:
parent
face0c02f0
commit
78eb36a1bb
|
@ -1159,6 +1159,13 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
$plain = str_replace($url->url, '', $plain);
|
$plain = str_replace($url->url, '', $plain);
|
||||||
|
|
||||||
if ($url->url && $url->expanded_url && $url->display_url) {
|
if ($url->url && $url->expanded_url && $url->display_url) {
|
||||||
|
// Quote tweet, we just remove the quoted tweet URL from the body, the share block will be added later.
|
||||||
|
if (isset($item->quoted_status_id_str)
|
||||||
|
&& substr($url->expanded_url, -strlen($item->quoted_status_id_str)) == $item->quoted_status_id_str ) {
|
||||||
|
$body = str_replace($url->url, '', $body);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$expanded_url = Network::finalUrl($url->expanded_url);
|
$expanded_url = Network::finalUrl($url->expanded_url);
|
||||||
|
|
||||||
$oembed_data = OEmbed::fetchURL($expanded_url);
|
$oembed_data = OEmbed::fetchURL($expanded_url);
|
||||||
|
@ -1221,6 +1228,8 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Footer will be taken care of with a share block in the case of a quote
|
||||||
|
if (empty($item->quoted_status)) {
|
||||||
if ($footerurl != "") {
|
if ($footerurl != "") {
|
||||||
$footer = add_page_info($footerurl, false, $picture);
|
$footer = add_page_info($footerurl, false, $picture);
|
||||||
}
|
}
|
||||||
|
@ -1241,6 +1250,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
$body = add_page_info_to_body($body);
|
$body = add_page_info_to_body($body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// it seems as if the entities aren't always covering all mentions. So the rest will be checked here
|
// it seems as if the entities aren't always covering all mentions. So the rest will be checked here
|
||||||
$tags = get_tags($body);
|
$tags = get_tags($body);
|
||||||
|
@ -1448,7 +1458,7 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
||||||
$postarray['allow_cid'] = '';
|
$postarray['allow_cid'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_string($post->full_text)) {
|
if (!empty($post->full_text)) {
|
||||||
$postarray['body'] = $post->full_text;
|
$postarray['body'] = $post->full_text;
|
||||||
} else {
|
} else {
|
||||||
$postarray['body'] = $post->text;
|
$postarray['body'] = $post->text;
|
||||||
|
@ -1507,8 +1517,6 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$postarray['body'] = $statustext;
|
|
||||||
|
|
||||||
$postarray['body'] .= "\n" . share_header(
|
$postarray['body'] .= "\n" . share_header(
|
||||||
$quoted['author-name'],
|
$quoted['author-name'],
|
||||||
$quoted['author-link'],
|
$quoted['author-link'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user