mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:40:17 +00:00
Update routine to transfer the blockem list to collapsed
This commit is contained in:
parent
5738d480da
commit
b0aa4eb4b7
3 changed files with 17 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
-- ------------------------------------------
|
||||
-- Friendica 2023.03-dev (Giant Rhubarb)
|
||||
-- DB_UPDATE_VERSION 1509
|
||||
-- DB_UPDATE_VERSION 1510
|
||||
-- ------------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
use Friendica\Database\DBA;
|
||||
|
||||
if (!defined('DB_UPDATE_VERSION')) {
|
||||
define('DB_UPDATE_VERSION', 1509);
|
||||
define('DB_UPDATE_VERSION', 1510);
|
||||
}
|
||||
|
||||
return [
|
||||
|
|
15
update.php
15
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue