diff options
author | Evan Prodromou <evan@status.net> | 2010-09-04 15:05:38 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-09-07 04:00:58 -0400 |
commit | 928239ecf88f1dc761a7a39d77714f5687e20833 (patch) | |
tree | 45a02248fdca52e8d724b90927709cb323184d8c /plugins/TwitterBridge/daemons/twitterstatusfetcher.php | |
parent | 1bf4972cc055f013c0a96df7d2d44b55b5e0a12d (diff) |
do our own repeating so we can pass in a uri
Diffstat (limited to 'plugins/TwitterBridge/daemons/twitterstatusfetcher.php')
-rwxr-xr-x | plugins/TwitterBridge/daemons/twitterstatusfetcher.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php index e5fac1fec..4e4befe06 100755 --- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php +++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php @@ -265,9 +265,23 @@ class TwitterStatusFetcher extends ParallelizingDaemon if (!empty($status->retweeted_status)) { common_log(LOG_INFO, "Status {$status->id} is a retweet of {$status->retweeted_status->id}."); $original = $this->saveStatus($status->retweeted_status); - $repeat = $original->repeat($profile->id, 'twitter'); - common_log(LOG_INFO, "Saved {$repeat->id} as a repeat of {$original->id}"); - return $repeat; + if (empty($original)) { + return null; + } else { + $author = $original->getProfile(); + // TRANS: Message used to repeat a notice. RT is the abbreviation of 'retweet'. + // TRANS: %1$s is the repeated user's name, %2$s is the repeated notice. + $content = sprintf(_('RT @%1$s %2$s'), + $author->nickname, + $original->content); + $repeat = Notice::saveNew($profile->id, + $content, + 'twitter', + array('repeat_of' => $original->id, + 'uri' => $statusUri)); + common_log(LOG_INFO, "Saved {$repeat->id} as a repeat of {$original->id}"); + return $repeat; + } } $notice = new Notice(); |