From cd26ead043f9cb92ca4d59e587480520cb51f117 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 23 Jun 2023 09:13:51 +0000 Subject: implement optional moderation of unsolicited comments, minor css fixes and some more work on ocap --- Zotlabs/Module/Moderate.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Module/Moderate.php') diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php index b66b052a6..b895b4a8c 100644 --- a/Zotlabs/Module/Moderate.php +++ b/Zotlabs/Module/Moderate.php @@ -17,7 +17,7 @@ class Moderate extends \Zotlabs\Web\Controller { } \App::set_pager_itemspage(30); - $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); + $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); //show all items if(argc() == 1) { @@ -40,8 +40,13 @@ class Moderate extends \Zotlabs\Web\Controller { if(argc() > 2) { $post_id = intval(argv(1)); - if(! $post_id) + if(! $post_id) { + if (is_ajax()) { + killme(); + } + goaway(z_root() . '/moderate'); + } $action = argv(2); @@ -61,18 +66,20 @@ class Moderate extends \Zotlabs\Web\Controller { ); $item['item_blocked'] = 0; - item_update_parent_commented($item); - notice( t('Comment approved') . EOL); } elseif($action === 'drop') { + // TODO: not implemented + // let the sender know we received their comment but we don't permit spam here. + // Activity::send_rejection_activity(App::get_channel(), $item['author_xchan'], $item); + drop_item($post_id,false); notice( t('Comment deleted') . EOL); - } + } // refetch the item after changes have been made - + $r = q("select * from item where id = %d", intval($post_id) ); @@ -84,6 +91,11 @@ class Moderate extends \Zotlabs\Web\Controller { if($action === 'approve') { \Zotlabs\Daemon\Master::Summon(array('Notifier', 'comment-new', $post_id)); } + + if (is_ajax()) { + killme(); + } + goaway(z_root() . '/moderate'); } } -- cgit v1.2.3 From 750641ef196d9e113b0e80da9734f70400b55652 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 27 Jun 2023 14:53:23 +0000 Subject: implement inline moderation of reactions --- Zotlabs/Module/Moderate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Moderate.php') diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php index b895b4a8c..ed2a1e4f9 100644 --- a/Zotlabs/Module/Moderate.php +++ b/Zotlabs/Module/Moderate.php @@ -67,7 +67,7 @@ class Moderate extends \Zotlabs\Web\Controller { $item['item_blocked'] = 0; item_update_parent_commented($item); - notice( t('Comment approved') . EOL); + notice( t('Item approved') . EOL); } elseif($action === 'drop') { // TODO: not implemented @@ -75,7 +75,7 @@ class Moderate extends \Zotlabs\Web\Controller { // Activity::send_rejection_activity(App::get_channel(), $item['author_xchan'], $item); drop_item($post_id,false); - notice( t('Comment deleted') . EOL); + notice( t('Item deleted') . EOL); } // refetch the item after changes have been made -- cgit v1.2.3