diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index f0f0ee52..189203bd 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -124,6 +124,7 @@ EOD private $apiKey = null; private $guestToken = null; private $authHeaders = []; + private ?string $feedIconUrl = null; public function detectParameters($url) { @@ -309,6 +310,10 @@ EOD } } + if ($this->queriedContext === 'By username') { + $this->feedIconUrl = $data->user_info->legacy->profile_image_url_https ?? null; + } + foreach ($tweets as $tweet) { // Skip own Retweets... if (isset($tweet->retweeted_status) && $tweet->retweeted_status->user->id_str === $tweet->user->id_str) { @@ -497,6 +502,11 @@ EOD; usort($this->items, ['TwitterBridge', 'compareTweetId']); } + public function getIcon() + { + return $this->feedIconUrl ?? parent::getIcon(); + } + private static function compareTweetId($tweet1, $tweet2) { return (intval($tweet1['id']) < intval($tweet2['id']) ? 1 : -1);