Merge pull request #6446 from annando/approve

Now storing the "manually approve" data / fix update routine
This commit is contained in:
Hypolite Petovan 2019-01-14 08:38:08 -05:00 committed by GitHub
commit 990bbea19d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 9 deletions

View file

@ -1239,7 +1239,7 @@ class DBA
foreach ($old_fields AS $fieldname => $content) {
if (isset($fields[$fieldname])) {
if ($fields[$fieldname] == $content) {
if (($fields[$fieldname] == $content) && !is_null($content)) {
unset($fields[$fieldname]);
} else {
$do_update = true;

View file

@ -157,7 +157,7 @@ class APContact extends BaseObject
$apcontact['pubkey'] = trim(JsonLD::fetchElement($compacted, 'w3id:publicKey', 'w3id:publicKeyPem'));
$manually_approve = JsonLD::fetchElement($compacted, 'as:manuallyApprovesFollowers');
$apcontact['manually-approve'] = (int)JsonLD::fetchElement($compacted, 'as:manuallyApprovesFollowers');
// To-Do
@ -204,8 +204,8 @@ class APContact extends BaseObject
$contact_fields['prv'] = false;
} else {
// Otherwise set the corresponding forum type
$contact_fields['forum'] = !$manually_approve;
$contact_fields['prv'] = $manually_approve;
$contact_fields['forum'] = !$apcontact['manually-approve'];
$contact_fields['prv'] = $apcontact['manually-approve'];
}
}
}