Use "rel" for "self" instead of using a separate field

This commit is contained in:
Michael 2021-09-12 19:04:27 +00:00
parent 19c3e55ca8
commit 3eea4b1130
2 changed files with 9 additions and 0 deletions

View File

@ -133,6 +133,7 @@ class Contact
const FOLLOWER = 1;
const SHARING = 2;
const FRIEND = 3;
const SELF = 4;
/**
* @}
*/

View File

@ -72,6 +72,10 @@ class User
$fields['ignored'] = $fields['readonly'];
}
if (!empty($fields['self'])) {
$fields['rel'] = Contact::SELF;
}
$fields = DBStructure::getFieldsForTable('user-contact', $fields);
$fields['cid'] = $pcid;
$fields['uid'] = $contact['uid'];
@ -105,6 +109,10 @@ class User
$fields['ignored'] = $fields['readonly'];
}
if (!empty($fields['self'])) {
$fields['rel'] = Contact::SELF;
}
$update_fields = DBStructure::getFieldsForTable('user-contact', $fields);
if (!empty($update_fields)) {
$contacts = DBA::select('contact', ['uri-id', 'uid'], $condition);