mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 03:35:13 +00:00
mastogroups - support moderation
This commit is contained in:
parent
efe8657cf2
commit
91f32b11ca
2 changed files with 17 additions and 1 deletions
|
@ -91,6 +91,18 @@ class Moderate extends Controller {
|
|||
Libsync::build_sync_packet(local_channel(),array('item' => array(encode_item($sync_item[0],true))));
|
||||
}
|
||||
if($action === 'approve') {
|
||||
if ($item['id'] !== $item['parent']) {
|
||||
// if this is a group comment, call tag_deliver() to generate the associated
|
||||
// Announce activity so microblog destinations will see it in their home timeline
|
||||
$role = get_pconfig(local_channel(),'system','permissions_role');
|
||||
$rolesettings = PermissionRoles::role_perms($role);
|
||||
$channel_type = isset($rolesettings['channel_type']) ? $rolesettings['channel_type'] : 'normal';
|
||||
|
||||
$is_group = (($channel_type === 'group') ? true : false);
|
||||
if ($is_group) {
|
||||
tag_deliver(local_channel(),$post_id);
|
||||
}
|
||||
}
|
||||
Run::Summon( [ 'Notifier', 'comment-new', $post_id ] );
|
||||
}
|
||||
goaway(z_root() . '/moderate');
|
||||
|
|
|
@ -2691,7 +2691,7 @@ function tag_deliver($uid, $item_id) {
|
|||
logger('check_item_source returns true');
|
||||
}
|
||||
|
||||
// This might be a followup (e.g. comment) by the original post author to an already uplinked item
|
||||
// This might be a followup (e.g. comment) to an already uplinked item
|
||||
// If so setup a second delivery chain
|
||||
|
||||
if (! intval($item['item_thread_top'])) {
|
||||
|
@ -2706,6 +2706,10 @@ function tag_deliver($uid, $item_id) {
|
|||
if ($item['verb'] === 'Announce' && $item['author_xchan'] === $u['channel_hash']) {
|
||||
return;
|
||||
}
|
||||
// don't boost moderated content until it has been approved
|
||||
if(intval($item['item_blocked']) === ITEM_MODERATED) {
|
||||
return;
|
||||
}
|
||||
logger('group_comment');
|
||||
start_delivery_chain($u, $item, $item_id, $x[0], true, (($item['edited'] != $item['created']) || $item['item_deleted']));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue