forked from friendica/friendica-addons
Merge pull request #838 from annando/twitter-reshare
Twitter: Use the new reshare mechanism for retweets
This commit is contained in:
commit
3710de0b5f
|
@ -1558,6 +1558,18 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$noquote) {
|
||||||
|
// Store the original tweet
|
||||||
|
Item::insert($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['source'] = $postarray['source'];
|
||||||
$retweet['private'] = $postarray['private'];
|
$retweet['private'] = $postarray['private'];
|
||||||
$retweet['allow_cid'] = $postarray['allow_cid'];
|
$retweet['allow_cid'] = $postarray['allow_cid'];
|
||||||
|
@ -1568,6 +1580,7 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
||||||
|
|
||||||
$postarray = $retweet;
|
$postarray = $retweet;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($post->quoted_status) && !$noquote) {
|
if (!empty($post->quoted_status) && !$noquote) {
|
||||||
$quoted = twitter_createpost($a, $uid, $post->quoted_status, $self, false, false, true);
|
$quoted = twitter_createpost($a, $uid, $post->quoted_status, $self, false, false, true);
|
||||||
|
|
Loading…
Reference in a new issue