pterotype/inc/blocks.php

21 lines
523 B
PHP
Raw Normal View History

2018-09-04 17:28:40 +00:00
<?php
namespace blocks;
/*
If an actor is in another actor's block list, any activities
from the blocked actor that go into the blocking actors' inbox
get ignored
*/
function create_block( $actor_id, $blocked_actor_url ) {
global $wpdb;
$res = $wpdb->insert(
2018-09-19 15:16:41 +00:00
'pterotype_activitypub_blocks',
2018-09-04 17:28:40 +00:00
array( 'actor_id' => $actor_id, 'blocked_actor_url' => $blocked_actor_url )
);
if ( !$res ) {
2018-09-19 15:16:41 +00:00
return new \WP_Error( 'db_error', __( 'Error inserting block row', 'pterotype' ) );
2018-09-04 17:28:40 +00:00
}
}
?>