You are here

function privatemsg_rules_tag_thread in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 privatemsg_rules/privatemsg_rules.rules.inc \privatemsg_rules_tag_thread()
  2. 7.2 privatemsg_rules/privatemsg_rules.rules.inc \privatemsg_rules_tag_thread()

File

privatemsg_rules/privatemsg_rules.rules.inc, line 386
Hooks and callback functions for rules.module integration.

Code

function privatemsg_rules_tag_thread($thread_id, $account, $tag_string) {
  $tags = explode(',', $tag_string);
  $tag_ids = privatemsg_filter_create_tags($tags);
  if (empty($tag_ids)) {
    rules_log('No valid tag could be loaded or created.', array(), RulesLog::ERROR);
    return;
  }
  privatemsg_filter_add_tags(array(
    $thread_id,
  ), $tag_ids, $account);
}