From 78facbcb83910a7934138a3f237c6bae90a3cadf Mon Sep 17 00:00:00 2001 From: somini Date: Sun, 26 Jul 2020 07:26:39 +0100 Subject: [PATCH] [TwitterBridge] Fix noretweet for users (#1608) This also removes spurious retweets. --- bridges/TwitterBridge.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index 7d69c808..a38479d4 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -212,9 +212,9 @@ EOD foreach($data->globalObjects->tweets as $tweet) { - // Skip retweets? - if($this->getInput('noretweet') - && isset($tweet->retweeted_status_id_str)) { + /* Debug::log('>>> ' . json_encode($tweet)); */ + // Skip spurious retweets + if (isset($tweet->retweeted_status_id_str) && substr($tweet->full_text, 0, 4) === 'RT @') { continue; } @@ -314,6 +314,11 @@ EOD; } } break; + case 'By username': + if ($this->getInput('noretweet') && $item['username'] != $this->getInput('u')) { + continue 2; // switch + for-loop! + } + break; default: }