From 246021fdfa7cb16153fed57ad1a9316dbda5afa9 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 8 Nov 2022 06:40:22 +0000 Subject: [PATCH] Store the source of incoming posts --- src/Model/Item.php | 7 ++++--- static/defaults.config.php | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 400e03a40..e0ee5607d 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1328,10 +1328,11 @@ class Item } } + if (!empty($source) && ($transmit || DI::config()->get('debug', 'store_source'))) { + Post\Activity::insert($item['uri-id'], $source); + } + if ($transmit) { - if (!empty($source)) { - Post\Activity::insert($item['uri-id'], $source); - } Worker::add(['priority' => $priority, 'dont_fork' => true], 'Notifier', $notify_type, (int)$posted_item['uri-id'], (int)$posted_item['uid']); } diff --git a/static/defaults.config.php b/static/defaults.config.php index 83c0d371f..ea9fca2f5 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -731,6 +731,10 @@ return [ // ap_log_failure (Boolean) // Logs every ActivityPub activity that couldn't be compacted 'ap_log_failure' => false, + + // store_source (Boolean) + // Store the source of any post that arrived + 'store_source' => false, ], 'smarty3' => [ // config_dir (String)