$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!'));
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;
}
}
- $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')) {
$options = array_merge($options, $locOptions);
}
- Event::handle('SaveNewNoticeWeb', array($this, $user, &$content_shortened, &$options));
$notice = Notice::saveNew($user->id, $content_shortened, 'web', $options);
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');
* @param array $options
* @return boolean hook return
*/
- function onSaveNewNoticeWeb($action, $user, &$content, &$options)
+ function onStartSaveNewNoticeWeb($action, $user, &$content, &$options)
{
$html = $this->sanitizeHtml($action->arg('status_textarea'));
$options['rendered'] = $html;