// The check for pending is in case the friendship was already approved
// and we just want to get rid of the pending contact
$condition = ['id' => $contact_id, 'uid' => local_user(),
- 'self' => false, 'pending' => true, 'rel' => Contact::FOLLOWER];
+ 'self' => false, 'pending' => true, 'rel' => [0, Contact::FOLLOWER]];
if (DBA::exists('contact', $condition)) {
Contact::remove($contact_id);
}
// Add intro entries for pending contacts
$pending_contacts = DBA::p("SELECT `uid`, `id`, `url`, `network`, `created` FROM `contact`
- WHERE `pending` AND `rel` = ? AND NOT EXISTS (SELECT `id` FROM `intro` WHERE `contact-id` = `contact`.`id`)", 0); //Contact::FOLLOWER);
+ WHERE `pending` AND `rel` IN (?, ?) AND NOT EXISTS (SELECT `id` FROM `intro` WHERE `contact-id` = `contact`.`id`)", 0, Contact::FOLLOWER);
while ($contact = DBA::fetch($pending_contacts)) {
DBA::insert('intro', ['uid' => $contact['uid'], 'contact-id' => $contact['id'], 'blocked' => false,
'hash' => Strings::getRandomHex(), 'datetime' => $contact['created']]);