Check if the Diaspora endpoint is archived
This commit is contained in:
parent
cf170c9c02
commit
3c9834922c
1 changed files with 6 additions and 3 deletions
|
@ -1564,13 +1564,13 @@ class Contact extends BaseObject
|
||||||
* @return boolean Is the contact archived?
|
* @return boolean Is the contact archived?
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public static function isArchived($cid)
|
public static function isArchived(int $cid)
|
||||||
{
|
{
|
||||||
if ($cid == 0) {
|
if ($cid == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$archived = DBA::selectFirst('contact', ['archive', 'url'], ['id' => $cid]);
|
$archived = DBA::selectFirst('contact', ['archive', 'url', 'batch'], ['id' => $cid]);
|
||||||
if (!DBA::isResult($archived)) {
|
if (!DBA::isResult($archived)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1592,7 +1592,10 @@ class Contact extends BaseObject
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @todo Add tests for Diaspora endpoints as well
|
if (!empty($archived['batch'])) {
|
||||||
|
return DBA::exists('contact', ['archive' => true, 'batch' => $archived['batch'], 'contact-type' => self::TYPE_RELAY]);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue