Commit ac7d5d81 authored by swentel's avatar swentel

Better params for send drush commands

parent daca398e
......@@ -115,8 +115,8 @@ cron or drush. Configure this at /admin/config/services/activitypub
The drush command is activitypub:send-activities which has 3 parameters
- send: send activity request (defaults to 1)
- debug: show command line debug messages (defaults to 0)
- delete: remove queue item (defaults to 1)
- debug: show command line debug messages (defaults to 0)
## Drush commands
......
......@@ -16,15 +16,15 @@ class ActivityPubCommands extends DrushCommands {
*
* @param int $send
* Whether to send to activities to inboxes.
* @param int $remove_queue_item
* Delete item from queue.
* @param int $debug
* Whether to view debug statements.
* @param int $remove_queue_item
* Delete from queue item.
*
* @command activitypub:send-activities
* @aliases asa,activitypub-send-activities
*/
public function sendActivities($send = 1, $debug = 0, $remove_queue_item = 1) {
public function sendActivities($send = 1, $remove_queue_item = 1, $debug = 0) {
if (\Drupal::config('activitypub.settings')->get('send_outbox_handler') == 'drush') {
// Make sure the host is not set to default.
......@@ -33,7 +33,7 @@ class ActivityPubCommands extends DrushCommands {
return;
}
\Drupal::service('activitypub.outbox.client')->handleOutboxQueue((bool) $send, (bool) $debug, (bool) $remove_queue_item);
\Drupal::service('activitypub.outbox.client')->handleOutboxQueue((bool) $send, (bool) $remove_queue_item, (bool) $debug);
}
}
......
......@@ -77,7 +77,7 @@ class ActivityPubOutboxClient implements ActivityPubOutboxClientInterface {
/**
* {@inheritdoc}
*/
public function handleOutboxQueue($send = TRUE, $remove_queue_item = TRUE, $debug = FALSE) {
public function handleOutboxQueue($send = TRUE, $remove_item_from_queue = TRUE, $debug = FALSE) {
$end = time() + 15;
$release_items = [];
$this->setDebug($debug);
......@@ -162,7 +162,7 @@ class ActivityPubOutboxClient implements ActivityPubOutboxClientInterface {
}
}
if (!$remove_queue_item) {
if (!$remove_item_from_queue) {
$remove_queue_item = FALSE;
}
}
......
......@@ -14,12 +14,12 @@ interface ActivityPubOutboxClientInterface {
*
* @param bool $send
* Whether to send to inboxes.
* @param bool $remove_queue_item
* Whether to remove the queue item.
* @param bool $remove_item_from_queue
* Whether to remove the item from the queue.
* @param bool $debug
* Whether to view debug statements, useful when using Drush.
*/
public function handleOutboxQueue($send = TRUE, $remove_queue_item = TRUE, $debug = FALSE);
public function handleOutboxQueue($send = TRUE, $remove_item_from_queue = TRUE, $debug = FALSE);
/**
* Generates a queue item.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment