From 5651f79466b48fb895b5ceeea3d0045a26c429bc Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 3 Sep 2010 17:51:28 -0400 Subject: [PATCH] if something's a retweet, save it as a repeat in bridge --- .../daemons/twitterstatusfetcher.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php index cf75e48f68..848e866697 100755 --- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php +++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php @@ -231,14 +231,14 @@ class TwitterStatusFetcher extends ParallelizingDaemon $flink->update(); } - function saveStatus($status, $flink) + function saveStatus($status, $flink=null) { $profile = $this->ensureProfile($status->user); if (empty($profile)) { common_log(LOG_ERR, $this->name() . ' - Problem saving notice. No associated Profile.'); - return; + return null; } $statusUri = $this->makeStatusURI($status->user->screen_name, $status->id); @@ -253,7 +253,14 @@ class TwitterStatusFetcher extends ParallelizingDaemon $this->name() . " - Ignoring duplicate import: $statusUri" ); - return; + return $dupe; + } + + // If it's a retweet, save it as a repeat! + + if (!empty($status->retweeted_status)) { + $original = $this->saveStatus($status->retweeted_status); + return $original->repeat($profile->id, 'twitter'); } $notice = new Notice(); @@ -305,7 +312,9 @@ class TwitterStatusFetcher extends ParallelizingDaemon Event::handle('EndNoticeSave', array($notice)); } - Inbox::insertNotice($flink->user_id, $notice->id); + if (!empty($flink)) { + Inbox::insertNotice($flink->user_id, $notice->id); + } $notice->blowOnInsert(); return $notice; -- 2.39.5