diff --git a/plugins/OStatus/scripts/gcfeeds.php b/plugins/OStatus/scripts/gcfeeds.php index a4f71ab77f..a95cd54dbc 100644 --- a/plugins/OStatus/scripts/gcfeeds.php +++ b/plugins/OStatus/scripts/gcfeeds.php @@ -20,20 +20,33 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); +$longoptions = array('delete-inactive'); +$shortoptions = 'd'; + $helptext = <<find(); while ($feedsub->fetch()) { try { echo $feedsub->getUri() . " ({$feedsub->sub_state})"; if ($feedsub->garbageCollect()) { + if ($delete_inactive) { + $delcount++; + $feedsub->delete(); + echo " DELETED"; + } echo " INACTIVE\n"; } else { echo " ACTIVE\n"; @@ -51,3 +64,5 @@ while ($feedsub->fetch()) { echo " ERROR: {$e->getMessage()}\n"; } } + +if ($delete_inactive) echo "\nDeleted $delcount inactive feeds.\n";