Add constants for the Fetch Further Information field

This commit is contained in:
Hypolite Petovan 2023-07-26 07:15:24 +02:00
parent 3a98b958d3
commit d0a2357fbd
6 changed files with 27 additions and 12 deletions

View file

@ -47,6 +47,12 @@ use Friendica\Model\Contact;
*/
class LocalRelationship extends \Friendica\BaseEntity
{
// Fetch Further Information options, not a binary flag
const FFI_NONE = 0;
const FFI_INFORMATION = 1;
const FFI_KEYWORD = 3;
const FFI_BOTH = 2;
/** @var int */
protected $userId;
/** @var int */
@ -70,6 +76,7 @@ class LocalRelationship extends \Friendica\BaseEntity
/** @var bool */
protected $isRemoteSelf;
/** @var int */
/** @var int One of FFI_* */
protected $fetchFurtherInformation;
/** @var string */
protected $ffiKeywordDenylist;
@ -84,7 +91,7 @@ class LocalRelationship extends \Friendica\BaseEntity
/** @var int */
protected $priority;
public function __construct(int $userId, int $contactId, bool $blocked = false, bool $ignored = false, bool $collapsed = false, bool $hidden = false, bool $pending = false, int $rel = Contact::NOTHING, string $info = '', bool $notifyNewPosts = false, bool $isRemoteSelf = false, int $fetchFurtherInformation = 0, string $ffiKeywordDenylist = '', bool $subhub = false, string $hubVerify = '', string $protocol = Protocol::PHANTOM, ?int $rating = null, ?int $priority = null)
public function __construct(int $userId, int $contactId, bool $blocked = false, bool $ignored = false, bool $collapsed = false, bool $hidden = false, bool $pending = false, int $rel = Contact::NOTHING, string $info = '', bool $notifyNewPosts = false, bool $isRemoteSelf = false, int $fetchFurtherInformation = self::FFI_NONE, string $ffiKeywordDenylist = '', bool $subhub = false, string $hubVerify = '', string $protocol = Protocol::PHANTOM, ?int $rating = null, ?int $priority = null)
{
$this->userId = $userId;
$this->contactId = $contactId;

View file

@ -46,7 +46,7 @@ class LocalRelationship extends BaseFactory implements ICanCreateFromTableRow
$row['info'] ?? '',
$row['notify_new_posts'] ?? false,
$row['remote_self'] ?? false,
$row['fetch_further_information'] ?? 0,
$row['fetch_further_information'] ?? Entity\LocalRelationship::FFI_NONE,
$row['ffi_keyword_denylist'] ?? '',
$row['subhub'] ?? false,
$row['hub-verify'] ?? '',