aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Activity.php22
-rw-r--r--Zotlabs/Lib/Enotify.php2
-rw-r--r--Zotlabs/Lib/ThreadItem.php5
3 files changed, 21 insertions, 8 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 79821badc..433024cf0 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2970,13 +2970,23 @@ class Activity {
}*/
if (!$allowed) {
- logger('rejected comment from ' . $item['author_xchan'] . ' for ' . $channel['channel_address']);
- logger('rejected: ' . print_r($item, true), LOGGER_DATA);
- // TODO: not implemented
- // let the sender know we received their comment but we don't permit spam here.
- // self::send_rejection_activity($channel,$item['author_xchan'],$item);
- return;
+ if (get_pconfig($channel['channel_id'], 'system', 'moderate_unsolicited_comments')) {
+ $item['item_blocked'] = intval(ITEM_MODERATED);
+ $allowed = true;
+ }
+ else {
+ hz_syslog('rejected comment from ' . $item['author_xchan'] . ' for ' . $channel['channel_address']);
+ logger('rejected: ' . print_r($item, true), LOGGER_DATA);
+
+ // TODO: not implemented
+ // let the sender know we received their comment but we don't permit spam here.
+ // self::send_rejection_activity($channel,$item['author_xchan'],$item);
+
+ return;
+ }
+
+
}
// TODO: not implemented
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 585761cc4..a8d34b940 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -145,7 +145,7 @@ class Enotify {
$itemlink = $params['link'];
- $action = t('commented on');
+ $action = (($moderated) ? t('requests to comment on') : t('commented on'));
if(array_key_exists('item',$params)) {
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index cf877ed92..14c9500ff 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -503,7 +503,10 @@ class ThreadItem {
'thread_level' => $thread_level,
'settings' => $settings,
'thr_parent' => (($item['parent_mid'] != $item['thr_parent']) ? gen_link_id($item['thr_parent']) : ''),
- 'contact_id' => (($contact) ? $contact['abook_id'] : '')
+ 'contact_id' => (($contact) ? $contact['abook_id'] : ''),
+ 'moderate' => ($item['item_blocked'] == ITEM_MODERATED),
+ 'moderate_approve' => t('Approve'),
+ 'moderate_delete' => t('Delete')
);