diff options
author | Ian Denhardt <ian@zenhack.net> | 2010-08-13 14:48:58 -0400 |
---|---|---|
committer | Ian Denhardt <ian@zenhack.net> | 2010-08-13 14:48:58 -0400 |
commit | b1c5cb9db99993fcea7c060bffa6d5d50f22a41f (patch) | |
tree | ad18b2aecce518d44d040f59b0e706bf128f43b9 /actions/newnotice.php | |
parent | df562a1d8f4515462b190a214a4b6642f7855130 (diff) | |
parent | ae696728f5edf8972c68c17ce9ea21f07d44cbed (diff) |
Merge branch '1.0.x' of /home/ian/public_html/statusnet-enhancements
Diffstat (limited to 'actions/newnotice.php')
-rw-r--r-- | actions/newnotice.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php index 748d104ff..8f1fb1c40 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -131,6 +131,8 @@ class NewnoticeAction extends Action $user = common_current_user(); assert($user); // XXX: maybe an error instead... $content = $this->trimmed('status_textarea'); + $options = array(); + Event::handle('StartSaveNewNoticeWeb', array($this, $user, &$content, &$options)); if (!$content) { $this->clientError(_('No content!')); @@ -157,11 +159,9 @@ class NewnoticeAction extends Action Notice::maxContent())); } - $replyto = $this->trimmed('inreplyto'); - #If an ID of 0 is wrongly passed here, it will cause a database error, - #so override it... - if ($replyto == 0) { - $replyto = 'false'; + $replyto = intval($this->trimmed('inreplyto')); + if ($replyto) { + $options['replyto'] = $replyto; } $upload = null; @@ -169,7 +169,10 @@ class NewnoticeAction extends Action if (isset($upload)) { - $content_shortened .= ' ' . $upload->shortUrl(); + if (Event::handle('StartSaveNewNoticeAppendAttachment', array($this, $upload, &$content_shortened, &$options))) { + $content_shortened .= ' ' . $upload->shortUrl(); + } + Event::handle('EndSaveNewNoticeAppendAttachment', array($this, $upload, &$content_shortened, &$options)); if (Notice::contentTooLong($content_shortened)) { $upload->delete(); @@ -182,8 +185,6 @@ class NewnoticeAction extends Action } } - $options = array('reply_to' => ($replyto == 'false') ? null : $replyto); - if ($user->shareLocation()) { // use browser data if checked; otherwise profile data if ($this->arg('notice_data-geo')) { @@ -208,6 +209,7 @@ class NewnoticeAction extends Action if (isset($upload)) { $upload->attachToNotice($notice); } + Event::handle('EndSaveNewNoticeWeb', array($this, $user, &$content_shortened, &$options)); if ($this->boolean('ajax')) { header('Content-Type: text/xml;charset=utf-8'); |