diff options
author | Evan Prodromou <evan@status.net> | 2009-12-11 11:51:09 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-12-11 11:51:09 -0500 |
commit | afc86a86d36dc8101c81d5d009546e4629db34a3 (patch) | |
tree | ea25a1aef4fc702f91f69cfb9a518d3eedb96334 /classes/Notice.php | |
parent | 60754fc6de8f73b3e74dbec30d91fffe11b094c6 (diff) |
save repeats from the form
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 228201188..82753fbdd 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -236,7 +236,14 @@ class Notice extends Memcached_DataObject $notice->source = $source; $notice->uri = $uri; - $notice->reply_to = self::getReplyTo($reply_to, $profile_id, $source, $final); + // Handle repeat case + + if (isset($repeat_of)) { + $notice->repeat_of = $repeat_of; + $notice->reply_to = $repeat_of; + } else { + $notice->reply_to = self::getReplyTo($reply_to, $profile_id, $source, $final); + } if (!empty($notice->reply_to)) { $reply = Notice::staticGet('id', $notice->reply_to); @@ -1434,4 +1441,18 @@ class Notice extends Memcached_DataObject return $location; } + + function repeat($repeater_id, $source) + { + $author = Profile::staticGet('id', $this->profile_id); + + // FIXME: truncate on long repeats...? + + $content = sprintf(_('RT @%1$s %2$s'), + $author->nickname, + $this->content); + + return self::saveNew($repeater_id, $content, $source, + array('repeat_of' => $this->id)); + } } |