Merge pull request #7963 from annando/issue-7659-a

Issue 7659: Udate the "user-contact" value with the "contact" values
This commit is contained in:
Philipp 2019-12-17 09:29:59 +01:00 committed by GitHub
commit 9b0427f5b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -34,7 +34,7 @@
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1326);
define('DB_UPDATE_VERSION', 1327);
}
return [

View File

@ -396,3 +396,15 @@ function update_1323()
return Update::SUCCESS;
}
function update_1327()
{
$contacts = DBA::select('contact', ['uid', 'id', 'blocked', 'readonly'], ["`uid` != ? AND (`blocked` OR `readonly`) AND NOT `pending`", 0]);
while ($contact = DBA::fetch($contacts)) {
Contact::setBlockedForUser($contact['id'], $contact['uid'], $contact['blocked']);
Contact::setIgnoredForUser($contact['id'], $contact['uid'], $contact['readonly']);
}
DBA::close($contacts);
return Update::SUCCESS;
}