You are here

function spambot_comment_insert in Spambot 8

Implements hook_node_insert().

File

./spambot.module, line 647
Main module file.

Code

function spambot_comment_insert($comment) {
  $connection = \Drupal::database();
  $connection
    ->update('comment_field_data')
    ->condition('cid', $comment
    ->id())
    ->fields([
    'hostname' => \Drupal::request()
      ->getClientIp(),
  ])
    ->execute();
}