aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/note_fragment.php
diff options
context:
space:
mode:
authorjade (winter)2026-05-09 15:50:43 +0100
committerjade (winter)2026-05-09 15:50:43 +0100
commitd9bf17761d6b770e8e56c642a8fa0f8e460a662f (patch)
treeea4352382dc2535162a98dd5f404c927248932a5 /routes/note_fragment.php
parente4a541e67fbd05a6bf657f95fdf221e702d50bae (diff)
add rudimentary language option and improve reply scope stuff
Diffstat (limited to 'routes/note_fragment.php')
-rw-r--r--routes/note_fragment.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/routes/note_fragment.php b/routes/note_fragment.php
index 76ef4b7..73702fe 100644
--- a/routes/note_fragment.php
+++ b/routes/note_fragment.php
@@ -99,11 +99,15 @@ Router::getInstance()->mount('/fragment/note/:id/reply', function (array $args)
$reply = Note::create(
$author->actor,
CommonMark::getInstance()->renderToPlainText($content),
- get_ui_language(), // TODO: actual language selector/detection
+ $_POST['language'] ?? $note->language,
$summary,
NotePrivacyScope::from($_POST['scope']),
(new UserSettings($author))->getBool('noteDefaults.indexable')
);
+ $interactors = NotePrivacyInteractors::from($_POST['interactors']);
+ $note->privacy->canReply = $interactors;
+ $note->privacy->canReshare = $interactors;
+ $note->privacy->canOtherInteract = $interactors;
$reply->formattedContent = [
'text/markdown' => $content,
'text/html' => CommonMark::getInstance()->renderToHtml($content)
@@ -173,7 +177,7 @@ Router::getInstance()->mount('/fragment/note', function (array $args) {
$note = Note::create(
$author->actor,
CommonMark::getInstance()->renderToPlainText($content),
- get_ui_language(), // TODO: actual language selector/detection
+ $_POST['language'] ?? get_ui_language(),
$summary,
NotePrivacyScope::from($_POST['scope']),
(new UserSettings($author))->getBool('noteDefaults.indexable')
@@ -241,4 +245,4 @@ Router::getInstance()->mount('/fragment/note/attachmentPill', function (array $a
'href' => $obj->getUrl()
]);
}
-}); \ No newline at end of file
+});