Use "rel" for "self" instead of using a separate field
This commit is contained in:
parent
19c3e55ca8
commit
3eea4b1130
2 changed files with 9 additions and 0 deletions
|
@ -133,6 +133,7 @@ class Contact
|
|||
const FOLLOWER = 1;
|
||||
const SHARING = 2;
|
||||
const FRIEND = 3;
|
||||
const SELF = 4;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue