mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 17:03:16 +00:00
Merge pull request #838 from annando/twitter-reshare
Twitter: Use the new reshare mechanism for retweets
This commit is contained in:
commit
3710de0b5f
1 changed files with 21 additions and 8 deletions
|
@ -1558,15 +1558,28 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
|||
return [];
|
||||
}
|
||||
|
||||
$retweet['source'] = $postarray['source'];
|
||||
$retweet['private'] = $postarray['private'];
|
||||
$retweet['allow_cid'] = $postarray['allow_cid'];
|
||||
$retweet['contact-id'] = $postarray['contact-id'];
|
||||
$retweet['owner-name'] = $postarray['owner-name'];
|
||||
$retweet['owner-link'] = $postarray['owner-link'];
|
||||
$retweet['owner-avatar'] = $postarray['owner-avatar'];
|
||||
if (!$noquote) {
|
||||
// Store the original tweet
|
||||
Item::insert($retweet);
|
||||
|
||||
$postarray = $retweet;
|
||||
// CHange the other post into a reshare activity
|
||||
$postarray['verb'] = ACTIVITY2_ANNOUNCE;
|
||||
$postarray['gravity'] = GRAVITY_ACTIVITY;
|
||||
$postarray['object-type'] = ACTIVITY_OBJ_NOTE;
|
||||
|
||||
$postarray['thr-parent'] = $retweet['uri'];
|
||||
$postarray['parent-uri'] = $retweet['uri'];
|
||||
} else {
|
||||
$retweet['source'] = $postarray['source'];
|
||||
$retweet['private'] = $postarray['private'];
|
||||
$retweet['allow_cid'] = $postarray['allow_cid'];
|
||||
$retweet['contact-id'] = $postarray['contact-id'];
|
||||
$retweet['owner-name'] = $postarray['owner-name'];
|
||||
$retweet['owner-link'] = $postarray['owner-link'];
|
||||
$retweet['owner-avatar'] = $postarray['owner-avatar'];
|
||||
|
||||
$postarray = $retweet;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($post->quoted_status) && !$noquote) {
|
||||
|
|
Loading…
Reference in a new issue