-- ------------------------------------------
-- Friendica 2023.03-dev (Giant Rhubarb)
--- DB_UPDATE_VERSION 1509
+-- DB_UPDATE_VERSION 1510
-- ------------------------------------------
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
- define('DB_UPDATE_VERSION', 1509);
+ define('DB_UPDATE_VERSION', 1510);
}
return [
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;
+}