foreign keys delete comments now

This commit is contained in:
Shish 2012-03-10 19:07:40 +00:00
parent f62edc3e83
commit a2d2ceb015

View File

@ -194,13 +194,6 @@ class CommentList extends Extension {
);
}
public function onImageDeletion(ImageDeletionEvent $event) {
global $database;
$image_id = $event->image->id;
$database->Execute("DELETE FROM comments WHERE image_id=:image_id", array("image_id"=>$image_id));
log_info("comment", "Deleting all comments for Image #$image_id");
}
// TODO: split akismet into a separate class, which can veto the event
public function onCommentPosting(CommentPostingEvent $event) {
$this->add_comment_wrapper($event->image_id, $event->user, $event->comment);