-
- if ($id) {
- common_broadcast_notices($id);
- common_redirect(common_local_url('shownotice',
- array('notice' => $id)), 303);
+
+ if (!$id) {
+ common_server_error(_('Problem saving notice.'));
+ return;
+ }
+
+ $orig = clone($notice);
+ $notice->uri = common_notice_uri($notice);
+
+ if (!$notice->update($orig)) {
+ common_server_error(_('Problem saving notice.'));
+ return;
+ }
+
+ common_save_replies($notice);
+ $notice->saveTags();
+ common_broadcast_notice($notice);
+
+ $returnto = $this->trimmed('returnto');
+ if ($returnto) {
+ $url = common_local_url($returnto,
+ array('nickname' => $user->nickname));