+
+ // Add intro entries for pending contacts
+ // We don't do this for DFRN entries since such revived contact requests seem to mostly fail.
+ $pending_contacts = DBA::p("SELECT `uid`, `id`, `url`, `network`, `created` FROM `contact`
+ WHERE `pending` AND `rel` IN (?, ?) AND `network` != ?
+ AND NOT EXISTS (SELECT `id` FROM `intro` WHERE `contact-id` = `contact`.`id`)",
+ 0, Contact::FOLLOWER, Protocol::DFRN);
+ while ($contact = DBA::fetch($pending_contacts)) {
+ DBA::insert('intro', ['uid' => $contact['uid'], 'contact-id' => $contact['id'], 'blocked' => false,
+ 'hash' => Strings::getRandomHex(), 'datetime' => $contact['created']]);
+ }
+ DBA::close($pending_contacts);
+ }
+
+ /**
+ * Moves up to 5000 attachments and photos to the current storage system.
+ * Self-replicates if legacy items have been found and moved.
+ *
+ * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ */
+ private static function moveStorage()
+ {
+ $current = StorageManager::getBackend();
+ $moved = StorageManager::move($current);
+
+ if ($moved) {
+ Worker::add(PRIORITY_LOW, "CronJobs", "move_storage");
+ }