diff options
Diffstat (limited to 'actions')
-rw-r--r-- | actions/newnotice.php | 2 | ||||
-rw-r--r-- | actions/postnotice.php | 2 | ||||
-rw-r--r-- | actions/showstream.php | 9 |
3 files changed, 12 insertions, 1 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php index 3abe875d5..de040ef77 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -53,6 +53,8 @@ class NewnoticeAction extends Action { return; } + $notice->rendered = common_render_content($notice->content, $notice); + $id = $notice->insert(); if (!$id) { diff --git a/actions/postnotice.php b/actions/postnotice.php index 718ebdab0..d83ceb971 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -78,6 +78,7 @@ class PostnoticeAction extends Action { $notice->profile_id = $remote_profile->id; $notice->uri = $notice_uri; $notice->content = $content; + $notice->rendered = common_render_content($notice->content, $notice); if ($notice_url) { $notice->url = $notice_url; } @@ -87,6 +88,7 @@ class PostnoticeAction extends Action { common_server_error(_t('Error inserting notice'), 500); return false; } + common_save_replies($notice); common_broadcast_notice($notice, true); } return true; diff --git a/actions/showstream.php b/actions/showstream.php index 406053531..eed63fab3 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -344,7 +344,14 @@ class ShowstreamAction extends StreamAction { if ($notice->find(true)) { # FIXME: URL, image, video, audio common_element_start('p', array('class' => 'notice_current')); - common_raw(common_render_content($notice->content, $notice)); + if ($notice->rendered) { + common_raw($notice->rendered); + } else { + # XXX: may be some uncooked notices in the DB, + # we cook them right now. This can probably disappear in future + # versions (>> 0.4.x) + common_raw(common_render_content($notice->content, $notice)); + } common_element_end('p'); } } |