]> git.mxchange.org Git - friendica.git/blobdiff - update.php
Merge pull request #9014 from annando/issue-9013
[friendica.git] / update.php
index f335b5292ec9efdaf90ec1c4d06e6c50cf9c1c9b..6152e2b1e01e144f760566d98cb3c42e8797477b 100644 (file)
@@ -376,8 +376,8 @@ 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']);
+               Contact\User::setBlocked($contact['id'], $contact['uid'], $contact['blocked']);
+               Contact\User::setIgnored($contact['id'], $contact['uid'], $contact['readonly']);
        }
        DBA::close($contacts);
 
@@ -562,3 +562,12 @@ function update_1357()
 
        return Update::SUCCESS;
 }
+
+function pre_update_1358()
+{
+       if (!DBA::e("DELETE FROM `contact-relation` WHERE NOT `relation-cid` IN (SELECT `id` FROM `contact`) OR NOT `cid` IN (SELECT `id` FROM `contact`)")) {
+               return Update::FAILED;
+       }
+
+       return Update::SUCCESS;
+}