You are here

function privatemsg_block_user in Privatemsg 5.3

Same name and namespace in other branches
  1. 5 privatemsg.module \privatemsg_block_user()
1 call to privatemsg_block_user()
privatemsg_block_user_form_submit in ./privatemsg.module
2 string references to 'privatemsg_block_user'
privatemsg_uninstall in ./privatemsg.install
privatemsg_update_4 in ./privatemsg.install

File

./privatemsg.module, line 482

Code

function privatemsg_block_user($author, $recipient = NULL) {
  global $user;
  $recipient = $recipient ? $recipient : $user->uid;
  if (!privatemsg_user_blocked($author, $recipient)) {
    db_query("INSERT INTO {privatemsg_block_user} (author, recipient) VALUES (%d, %d)", $author, $recipient);
    drupal_set_message(t('User has been blocked'));
  }
}