+
+ /**
+ * Add missing "intro" records.
+ *
+ * @return void
+ */
+ private static function addIntros()
+ {
+ $contacts = DBA::p("SELECT `uid`, `id`, `created` FROM `contact` WHERE `rel` = ? AND `pending` AND NOT EXISTS (SELECT `id` FROM `intro` WHERE `contact-id` = `contact`.`id`)", Contact::FOLLOWER);
+ while ($contact = DBA::fetch($contacts)) {
+ $fields = [
+ 'uid' => $contact['uid'],
+ 'contact-id' => $contact['id'],
+ 'datetime' => $contact['created'],
+ 'hash' => Strings::getRandomHex()
+ ];
+ Logger::notice('Adding missing intro', ['fields' => $fields]);
+ DBA::insert('intro', $fields);
+ }
+ }