From: Michael Vogel Date: Mon, 8 Jun 2020 06:37:26 +0000 (+0200) Subject: Merge pull request #986 from MrPetovan/task/twitter-ass-probe-detect-hook X-Git-Tag: 2020.07~15 X-Git-Url: https://reisub.nsupdate.info/git/?a=commitdiff_plain;h=86179eb3f45f4fc4ec99c5bc1410ea430f184d10;hp=6ce762010e6cb59cb9e53ee0f0751db7afef5caf;p=friendica-addons.git%2F.git Merge pull request #986 from MrPetovan/task/twitter-ass-probe-detect-hook [twitter] Add probe_detect hook function --- diff --git a/twitter/twitter.php b/twitter/twitter.php index fc49ce54..6e447591 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -83,7 +83,6 @@ use Friendica\Model\Item; use Friendica\Model\ItemContent; use Friendica\Model\ItemURI; use Friendica\Model\Tag; -use Friendica\Model\Term; use Friendica\Model\User; use Friendica\Protocol\Activity; use Friendica\Util\ConfigFileLoader; @@ -1621,23 +1620,27 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl } } - if (!empty($post->quoted_status) && !$noquote) { - $quoted = twitter_createpost($a, $uid, $post->quoted_status, $self, false, false, true, $uriid); - - if (!empty($quoted['body'])) { - $postarray['body'] .= "\n" . share_header( - $quoted['author-name'], - $quoted['author-link'], - $quoted['author-avatar'], - "", - $quoted['created'], - $quoted['plink'] - ); - - $postarray['body'] .= $quoted['body'] . '[/share]'; - } else { - // Quoted post author is blocked/ignored, so we just provide the link to avoid removing quote context. + if (!empty($post->quoted_status)) { + if ($noquote) { + // To avoid recursive share blocks we just provide the link to avoid removing quote context. $postarray['body'] .= "\n\nhttps://twitter.com/" . $post->quoted_status->user->screen_name . "/status/" . $post->quoted_status->id_str; + } else { + $quoted = twitter_createpost($a, $uid, $post->quoted_status, $self, false, false, true, $uriid); + if (!empty($quoted['body'])) { + $postarray['body'] .= "\n" . share_header( + $quoted['author-name'], + $quoted['author-link'], + $quoted['author-avatar'], + "", + $quoted['created'], + $quoted['plink'] + ); + + $postarray['body'] .= $quoted['body'] . '[/share]'; + } else { + // Quoted post author is blocked/ignored, so we just provide the link to avoid removing quote context. + $postarray['body'] .= "\n\nhttps://twitter.com/" . $post->quoted_status->user->screen_name . "/status/" . $post->quoted_status->id_str; + } } }