Move Contact::ACCOUNT_TYPE_* constants to User::ACCOUNT_TYPE_*

- Keep Contact::TYPE_* constants for comparison with contact.contact-type
This commit is contained in:
Hypolite Petovan 2019-01-06 17:08:35 -05:00
parent ad9c67663d
commit 3d839bb176
12 changed files with 79 additions and 44 deletions

View file

@ -503,13 +503,13 @@ class Receiver
// Check if the potential receiver is following the actor
// Exception: The receiver is targetted via "to" or this is a comment
if ((($element != 'as:to') && empty($replyto)) || ($contact['contact-type'] == Contact::ACCOUNT_TYPE_COMMUNITY)) {
if ((($element != 'as:to') && empty($replyto)) || ($contact['contact-type'] == Contact::TYPE_COMMUNITY)) {
$networks = [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS];
$condition = ['nurl' => Strings::normaliseLink($actor), 'rel' => [Contact::SHARING, Contact::FRIEND],
'network' => $networks, 'archive' => false, 'pending' => false, 'uid' => $contact['uid']];
// Forum posts are only accepted from forum contacts
if ($contact['contact-type'] == Contact::ACCOUNT_TYPE_COMMUNITY) {
if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
$condition['rel'] = [Contact::SHARING, Contact::FRIEND, Contact::FOLLOWER];
}
@ -576,7 +576,7 @@ class Receiver
// When the possible receiver isn't a community, then it is no valid receiver
$owner = User::getOwnerDataById($contact['uid']);
if (empty($owner) || ($owner['contact-type'] != Contact::ACCOUNT_TYPE_COMMUNITY)) {
if (empty($owner) || ($owner['contact-type'] != Contact::TYPE_COMMUNITY)) {
return false;
}