aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Moderate.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-06-23 09:13:51 +0000
committerMario <mario@mariovavti.com>2023-06-23 09:13:51 +0000
commitcd26ead043f9cb92ca4d59e587480520cb51f117 (patch)
tree6ffd776a1fa31f6dfb8462bd71c6a0b62157d3b2 /Zotlabs/Module/Moderate.php
parent6a560cfec4628ac5c727578c1360f84c569ee6b7 (diff)
downloadvolse-hubzilla-cd26ead043f9cb92ca4d59e587480520cb51f117.tar.gz
volse-hubzilla-cd26ead043f9cb92ca4d59e587480520cb51f117.tar.bz2
volse-hubzilla-cd26ead043f9cb92ca4d59e587480520cb51f117.zip
implement optional moderation of unsolicited comments, minor css fixes and some more work on ocap
Diffstat (limited to 'Zotlabs/Module/Moderate.php')
-rw-r--r--Zotlabs/Module/Moderate.php24
1 files changed, 18 insertions, 6 deletions
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');
}
}