You are here

function heartbeat_rules_users_action in Heartbeat 6.3

Same name and namespace in other branches
  1. 6.4 modules/heartbeat_rules/hrules.rules.inc \heartbeat_rules_users_action()

Action Implementation: Log an activity between two users

@ToDo figure out what params mean / can do

Parameters

array $settings:

array form:

array with two arrays (set_info and variables):

1 string reference to 'heartbeat_rules_users_action'
friendlist_activity_rules_defaults in modules/friendlist_activity/friendlist_activity.rules_defaults.inc
Implementation of hook_rules_defaults();

File

./heartbeat.rules.inc, line 398

Code

function heartbeat_rules_users_action($settings, $form = array(), $event_info = array()) {

  //dsm($message);
  $data = array();
  if (is_array($settings)) {

    // Normal form values
    $data['uid'] = $settings['uid_param'];
    $data['uid_target'] = $settings['uid_target_param'];
    $data['nid_target'] = 0;
    $data['message_id'] = $settings['message_id_param'];

    // Relational message of heartbeat messages
    $message = heartbeat_load_message($data['message_id']);
    $data['message'] = $message->message;
    $data['message_concat'] = $message->message_concat;
    $data['variables'] = $settings['variables_param'];
  }
  heartbeat_log($data);
}