[twitter] Remove references to obsolete virtual field item.tag

This commit is contained in:
Hypolite Petovan 2020-05-13 22:40:02 -04:00
parent cf6bf67fd8
commit 5e397ad580

View File

@ -1224,14 +1224,12 @@ function twitter_expand_entities($body, stdClass $status, $picture)
{ {
$plain = $body; $plain = $body;
$tags = [];
$taglist = []; $taglist = [];
$replacementList = []; $replacementList = [];
foreach ($status->entities->hashtags AS $hashtag) { foreach ($status->entities->hashtags AS $hashtag) {
$replace = '#[url=' . DI::baseUrl()->get() . '/search?tag=' . $hashtag->text . ']' . $hashtag->text . '[/url]'; $replace = '#[url=' . DI::baseUrl()->get() . '/search?tag=' . $hashtag->text . ']' . $hashtag->text . '[/url]';
$tags['#' . $hashtag->text] = $replace;
$taglist['#' . $hashtag->text] = ['#', $hashtag->text, '']; $taglist['#' . $hashtag->text] = ['#', $hashtag->text, ''];
$replacementList[$hashtag->indices[0]] = [ $replacementList[$hashtag->indices[0]] = [
@ -1242,7 +1240,6 @@ function twitter_expand_entities($body, stdClass $status, $picture)
foreach ($status->entities->user_mentions AS $mention) { foreach ($status->entities->user_mentions AS $mention) {
$replace = '@[url=https://twitter.com/' . rawurlencode($mention->screen_name) . ']' . $mention->screen_name . '[/url]'; $replace = '@[url=https://twitter.com/' . rawurlencode($mention->screen_name) . ']' . $mention->screen_name . '[/url]';
$tags['@' . $mention->screen_name] = $replace;
$taglist['@' . $mention->screen_name] = ['@', $mention->screen_name, 'https://twitter.com/' . rawurlencode($mention->screen_name)]; $taglist['@' . $mention->screen_name] = ['@', $mention->screen_name, 'https://twitter.com/' . rawurlencode($mention->screen_name)];
$replacementList[$mention->indices[0]] = [ $replacementList[$mention->indices[0]] = [
@ -1344,7 +1341,7 @@ function twitter_expand_entities($body, stdClass $status, $picture)
} }
} }
return ['body' => $body, 'tags' => $tags, 'plain' => $plain, 'taglist' => $taglist]; return ['body' => $body, 'plain' => $plain, 'taglist' => $taglist];
} }
/** /**
@ -1557,7 +1554,6 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
$converted = twitter_expand_entities($postarray['body'], $post, $picture); $converted = twitter_expand_entities($postarray['body'], $post, $picture);
$postarray['body'] = $converted['body']; $postarray['body'] = $converted['body'];
$postarray['tag'] = implode(',', $converted['tags']);
$postarray['created'] = DateTimeFormat::utc($post->created_at); $postarray['created'] = DateTimeFormat::utc($post->created_at);
$postarray['edited'] = DateTimeFormat::utc($post->created_at); $postarray['edited'] = DateTimeFormat::utc($post->created_at);