You are here

function pm_block_user_has_blocked in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 pm_block_user/pm_block_user.module \pm_block_user_has_blocked()
  2. 7.2 pm_block_user/pm_block_user.module \pm_block_user_has_blocked()

Checks if author is blocked by the recipient.

Parameters

$author: The user that would send a message.

$recipient: The user that would receive the message.

Return value

TRUE if the recipient has blocked the author.

3 calls to pm_block_user_has_blocked()
pm_block_user_block_validate in pm_block_user/pm_block_user.pages.inc
Validate user names.
pm_block_user_form in pm_block_user/pm_block_user.pages.inc
@file User menu callbacks for pm_block_user.module.
_pm_block_user_access in pm_block_user/pm_block_user.module
Provides access argument for blocking user menu item.

File

pm_block_user/pm_block_user.module, line 202
Allows users to block other users from sending them any messages

Code

function pm_block_user_has_blocked($author, $recipient) {
  return db_query('SELECT 1 FROM {pm_block_user} WHERE author = :author AND recipient = :recipient', array(
    ':author' => $author->uid,
    ':recipient' => $recipient->uid,
  ))
    ->fetchField();
}