- 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();
- // TRANS: Client error displayed exceeding the maximum notice length.
- // TRANS: %d is the maximum length for a notice.
- $this->clientError(sprintf(_m('Maximum notice size is %d character, including attachment URL.',
- 'Maximum notice size is %d characters, including attachment URL.',
- Notice::maxContent()),
- Notice::maxContent()));
- }
+
+ $act->context = new ActivityContext();
+
+ if ($parent instanceof Notice) {
+ $act->context->replyToID = $parent->getUri();
+ $act->context->replyToUrl = $parent->getUrl(true); // maybe we don't have to send true here to force a URL?