aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes
diff options
context:
space:
mode:
authorwinter2025-03-30 19:18:51 +0100
committerwinter2025-03-30 19:18:51 +0100
commitb5ec7311ef03232099dd3f8b30298738e1d0937e (patch)
tree2b880f4828c1b4aebc311c1accb84c9f8b3692ae /routes
parentcd10f94269d7dcdd93df9fcda142a1e5a4441ae9 (diff)
allow changing indexable setting
Diffstat (limited to 'routes')
-rw-r--r--routes/note_fragment.php8
-rw-r--r--routes/preferences.php1
2 files changed, 6 insertions, 3 deletions
diff --git a/routes/note_fragment.php b/routes/note_fragment.php
index 3d3c658..ff9559c 100644
--- a/routes/note_fragment.php
+++ b/routes/note_fragment.php
@@ -11,13 +11,13 @@ use Digitigrade\Model\Note;
use Digitigrade\Model\NoteAttachment;
use Digitigrade\Model\NotePrivacyInteractors;
use Digitigrade\Model\NotePrivacyScope;
-use Digitigrade\Model\Notification;
use Digitigrade\Model\StorageObject;
use Digitigrade\Model\UserAccount;
use Digitigrade\Notification\AdminEditedNoteNotif;
use Digitigrade\PolicyManager;
use Digitigrade\Router;
use Digitigrade\StorageProvider\FilesystemStorage;
+use Digitigrade\UserSettings;
Router::getInstance()->mount('/fragment/note/:id', function (array $args) {
$note = Note::find($args['id']);
@@ -101,7 +101,8 @@ Router::getInstance()->mount('/fragment/note/:id/reply', function (array $args)
CommonMark::getInstance()->renderToPlainText($content),
get_ui_language(), // TODO: actual language selector/detection
$summary,
- NotePrivacyScope::from($_POST['scope'])
+ NotePrivacyScope::from($_POST['scope']),
+ (new UserSettings($author))->getBool('noteDefaults.indexable')
);
$reply->formattedContent = [
'text/markdown' => $content,
@@ -171,7 +172,8 @@ Router::getInstance()->mount('/fragment/note', function (array $args) {
CommonMark::getInstance()->renderToPlainText($content),
get_ui_language(), // TODO: actual language selector/detection
$summary,
- NotePrivacyScope::from($_POST['scope'])
+ NotePrivacyScope::from($_POST['scope']),
+ (new UserSettings($author))->getBool('noteDefaults.indexable')
);
$interactors = NotePrivacyInteractors::from($_POST['interactors']);
$note->privacy->canReply = $interactors;
diff --git a/routes/preferences.php b/routes/preferences.php
index 8ccf74e..40e41fd 100644
--- a/routes/preferences.php
+++ b/routes/preferences.php
@@ -21,6 +21,7 @@ Router::getInstance()->mount('/fragment/preferences', function (array $args) {
$settings->set('interface.smallUnreadIndicators', $_POST['smallIndicators']);
$settings->set('locale.timezone', $_POST['timezone']);
$settings->set('profile.rssEnabled', $_POST['rssEnabled']);
+ $settings->set('noteDefaults.indexable', $_POST['notesIndexable']);
$saved = true;
}