X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fnewnotice.php;h=ea832cf4e1300ec0ce75424c40f9f4e8530e1164;hb=f2d6e1e375410bee0efc90c80b1e74699a4c6b7d;hp=8263198f7383c1b38f10c3361a31d423257bb164;hpb=527561cd93b69ddaba660f272462aadfaef0c511;p=quix0rs-gnu-social.git diff --git a/actions/newnotice.php b/actions/newnotice.php index 8263198f73..ea832cf4e1 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -161,7 +161,7 @@ class NewnoticeAction extends Action $replyto = intval($this->trimmed('inreplyto')); if ($replyto) { - $options['replyto'] = $replyto; + $options['reply_to'] = $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(); @@ -201,10 +204,18 @@ class NewnoticeAction extends Action $options = array_merge($options, $locOptions); } - $notice = Notice::saveNew($user->id, $content_shortened, 'web', $options); + $author_id = $user->id; + $text = $content_shortened; - if (isset($upload)) { - $upload->attachToNotice($notice); + if (Event::handle('StartNoticeSaveWeb', array($this, &$author_id, &$text, &$options))) { + + $notice = Notice::saveNew($user->id, $content_shortened, 'web', $options); + + if (isset($upload)) { + $upload->attachToNotice($notice); + } + + Event::handle('EndNoticeSaveWeb', array($this, $notice)); } Event::handle('EndSaveNewNoticeWeb', array($this, $user, &$content_shortened, &$options));