Preparation for the possibility to globally block contacts
This commit is contained in:
parent
cc9074bed5
commit
c6dbbe21b4
3 changed files with 54 additions and 1 deletions
|
@ -695,6 +695,44 @@ function get_contact($url, $uid = 0, $no_update = false) {
|
|||
return $contact_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Checks if the contact is blocked
|
||||
*
|
||||
* @param int $cid contact id
|
||||
*
|
||||
* @return boolean Is the contact blocked?
|
||||
*/
|
||||
function blockedContact($cid) {
|
||||
if ($cid == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$blocked = dba::select('contact', array('blocked'), array('id' => $cid), array('limit' => 1));
|
||||
if (!dbm::is_result($blocked)) {
|
||||
return false;
|
||||
}
|
||||
return (bool)$blocked['blocked'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Checks if the contact is hidden
|
||||
*
|
||||
* @param int $cid contact id
|
||||
*
|
||||
* @return boolean Is the contact hidden?
|
||||
*/
|
||||
function hiddenContact($cid) {
|
||||
if ($cid == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$hidden = dba::select('contact', array('hidden'), array('id' => $cid), array('limit' => 1));
|
||||
if (!dbm::is_result($hidden)) {
|
||||
return false;
|
||||
}
|
||||
return (bool)$hidden['hidden'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns posts from a given gcontact
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue