]> git.mxchange.org Git - friendica.git/commitdiff
Update routine to transfer the blockem list to collapsed
authorMichael <heluecht@pirati.ca>
Sun, 8 Jan 2023 18:59:07 +0000 (18:59 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 8 Jan 2023 18:59:07 +0000 (18:59 +0000)
database.sql
static/dbstructure.config.php
update.php

index 9ffa3544acec3a76a45e2e62fde6dad1af178e4e..e06454b1145d8927925efe21a53dfcf43c1a4883 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2023.03-dev (Giant Rhubarb)
--- DB_UPDATE_VERSION 1509
+-- DB_UPDATE_VERSION 1510
 -- ------------------------------------------
 
 
index 848da04040f8804bbb918a86341b9efbd9accce2..d25d9cc3f1ddaac8b8a037a836e1c709341bc9c5 100644 (file)
@@ -55,7 +55,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1509);
+       define('DB_UPDATE_VERSION', 1510);
 }
 
 return [
index 0491e4a92c523a22f04d72402ea5990f63e308a5..951f54a3b2c74bfb92539367154944181c9f05e1 100644 (file)
@@ -1213,3 +1213,18 @@ function update_1509()
 
        return Update::SUCCESS;
 }
+
+function update_1510()
+{
+       $blocks = DBA::select('pconfig', ['uid', 'v'], ['cat' => 'blockem', 'k' => 'words']);
+       while ($block = DBA::fetch($blocks)) {
+               foreach (explode(',', $block['v']) as $account) {
+                       $id = Contact::getIdForURL(trim($account), 0, false);
+                       if (empty($id)) {
+                               continue;
+                       }
+                       Contact\User::setCollapsed($id, $block['uid'], true);
+               }
+       }
+       return Update::SUCCESS;
+}