의 미러
https://github.com/friendica/friendica
synced 2025-09-07 21:21:52 +02:00
Check if the Diaspora endpoint is archived
This commit is contained in:
부모
cf170c9c02
커밋
3c9834922c
1개의 변경된 파일과 6개의 추가작업 그리고 3개의 파일을 삭제
|
@ -1564,13 +1564,13 @@ class Contact extends BaseObject
|
|||
* @return boolean Is the contact archived?
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function isArchived($cid)
|
||||
public static function isArchived(int $cid)
|
||||
{
|
||||
if ($cid == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$archived = DBA::selectFirst('contact', ['archive', 'url'], ['id' => $cid]);
|
||||
$archived = DBA::selectFirst('contact', ['archive', 'url', 'batch'], ['id' => $cid]);
|
||||
if (!DBA::isResult($archived)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1592,7 +1592,10 @@ class Contact extends BaseObject
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
불러오는 중…
테이블 추가
Add a link
Reference in a new issue