summaryrefslogtreecommitdiff
path: root/actions/newnotice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-08-13 14:35:49 -0700
committerEvan Prodromou <evan@status.net>2010-08-13 14:35:49 -0700
commit926c77246bb168097b3f937b5cc22ee9721b83c9 (patch)
treedea05edb30a9e6a1e7971727ea42c7214c06c808 /actions/newnotice.php
parent029aa0c61c9942c0688fd3dc9aa2893311543db1 (diff)
parent61ab21b711c3248c72c8336f481e8aa3d432c997 (diff)
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts: plugins/OStatus/classes/Ostatus_profile.php
Diffstat (limited to 'actions/newnotice.php')
-rw-r--r--actions/newnotice.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 748d104ff..61b38786b 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['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();
@@ -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');