summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-03 17:51:28 -0400
committerEvan Prodromou <evan@status.net>2010-09-07 04:00:57 -0400
commit5651f79466b48fb895b5ceeea3d0045a26c429bc (patch)
treed4964860018bb3bcd6f314b4d8983a251fc86db7
parentd6719760d61b204ab7cf5ce013f2933ef4024f1a (diff)
if something's a retweet, save it as a repeat in bridge
-rwxr-xr-xplugins/TwitterBridge/daemons/twitterstatusfetcher.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
index cf75e48f6..848e86669 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;