+ $content = $this->scoped->shortenLinks($content);
+
+ // Reject notice if it is too long (without the HTML)
+ // This is done after MediaFile::fromUpload etc. just to act the same as the ApiStatusesUpdateAction
+ if (Notice::contentTooLong($content)) {
+ // TRANS: Client error displayed when the parameter "status" is missing.
+ // TRANS: %d is the maximum number of character for a notice.
+ throw new ClientException(sprintf(_m('That\'s too long. Maximum notice size is %d character.',
+ 'That\'s too long. Maximum notice size is %d characters.',
+ Notice::maxContent()),
+ Notice::maxContent()));
+ }
+
+ $actobj = new ActivityObject();
+ $actobj->type = ActivityObject::NOTE;
+ $actobj->content = common_render_content($content, $this->scoped, $parent);
+
+ $act->objects[] = $actobj;
+
+
+ $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?
+ }