diff --git a/database.sql b/database.sql index 9ffa3544a..e06454b11 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2023.03-dev (Giant Rhubarb) --- DB_UPDATE_VERSION 1509 +-- DB_UPDATE_VERSION 1510 -- ------------------------------------------ diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 848da0404..d25d9cc3f 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -55,7 +55,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1509); + define('DB_UPDATE_VERSION', 1510); } return [ diff --git a/update.php b/update.php index 0491e4a92..951f54a3b 100644 --- a/update.php +++ b/update.php @@ -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; +}