Remember to clear history for group if reset.

This commit is contained in:
Retro_Guy 2024-06-11 05:28:56 -07:00
parent 7390e2a9bc
commit c1c53e3d71
1 changed files with 7 additions and 0 deletions

View File

@ -221,6 +221,13 @@ function remove_articles($group)
echo "Deleting " . $delme . " from " . $group . "\n"; echo "Deleting " . $delme . " from " . $group . "\n";
} }
# History
$history_dbh = history_db_open($spooldir . '/history.db3');
$clear_stmt = $history_dbh->prepare("DELETE FROM history WHERE newsgroup=:group");
$clear_stmt->bindParam(':group', $group);
$clear_stmt->execute();
$history_dbh = null;
rename($spooldir . '/' . $group . '-articles.db3', $spooldir . '/' . $group . '-articles.db3-removed'); rename($spooldir . '/' . $group . '-articles.db3', $spooldir . '/' . $group . '-articles.db3-removed');
unlink($spooldir . '/' . $group . '-data.db3'); unlink($spooldir . '/' . $group . '-data.db3');
unlink($spooldir . '/' . $group . '-info.txt'); unlink($spooldir . '/' . $group . '-info.txt');