diff options
author | Mario <mario@mariovavti.com> | 2023-07-11 18:57:18 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-07-11 18:57:18 +0000 |
commit | 63fb8d03929189bfc8cbf53d23cb79984fe2c3cd (patch) | |
tree | b9f74bd8c7721dca7ece251fdbb9a7c4fe9b949a /Zotlabs/Module/Moderate.php | |
parent | 57796a2f962d045445cbf69237bb3d6786e4d0d4 (diff) | |
parent | 384de0925e502cfa8fe6ca287530ef5529fdff10 (diff) | |
download | volse-hubzilla-63fb8d03929189bfc8cbf53d23cb79984fe2c3cd.tar.gz volse-hubzilla-63fb8d03929189bfc8cbf53d23cb79984fe2c3cd.tar.bz2 volse-hubzilla-63fb8d03929189bfc8cbf53d23cb79984fe2c3cd.zip |
Merge branch '8.6RC'8.6
Diffstat (limited to 'Zotlabs/Module/Moderate.php')
-rw-r--r-- | Zotlabs/Module/Moderate.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php index b66b052a6..ed2a1e4f9 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); + notice( t('Item 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); - } + notice( t('Item 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'); } } |