You are here

function _cleantalk_send_feedback in Anti Spam by CleanTalk 7

Same name and namespace in other branches
  1. 8 cleantalk.module \_cleantalk_send_feedback()
  2. 7.2 cleantalk.module \_cleantalk_send_feedback()

Cleantalk inner function - sends feedback to server.

3 calls to _cleantalk_send_feedback()
cleantalk_comment_delete in ./cleantalk.module
Implements hook_comment_delete().
cleantalk_comment_publish in ./cleantalk.module
Implements hook_comment_publish().
cleantalk_user_delete in ./cleantalk.module
Implements hook_user_delete().

File

./cleantalk.module, line 1566
Main CleanTalk integration module functions.

Code

function _cleantalk_send_feedback($request_id, $feedback) {
  $ct_authkey = variable_get('cleantalk_authkey', '');
  $ct_ws = _cleantalk_get_ws();
  $ct = new Cleantalk();
  $ct->work_url = $ct_ws['work_url'];
  $ct->server_url = $ct_ws['server_url'];
  $ct->server_ttl = $ct_ws['server_ttl'];
  $ct->server_changed = $ct_ws['server_changed'];
  $ct_request = new CleantalkRequest();
  $ct_request->auth_key = $ct_authkey;
  $ct_request->agent = 'drupal-1120';
  $ct_request->sender_ip = ip_address();
  $ct_request->feedback = $request_id . ':' . $feedback;
  $ct
    ->sendFeedback($ct_request);
}