]> git.mxchange.org Git - friendica.git/commitdiff
We have to check for "0" in "rel" as well
authorMichael <heluecht@pirati.ca>
Mon, 9 Sep 2019 20:39:19 +0000 (20:39 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 9 Sep 2019 20:39:19 +0000 (20:39 +0000)
mod/notifications.php
src/Worker/CronJobs.php

index ac642122c28af096661aa360ac861a3e0c24a68e..3276e65491dc9060541c2dd3e5ca7c46569b0862 100644 (file)
@@ -52,7 +52,7 @@ function notifications_post(App $a)
                                // 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);
                                }
index 32f9b64aa4f8555221e3035c2f7145fea6540e6c..ba489717478ada36c7452fc3ad12913e3381a0ab 100644 (file)
@@ -305,7 +305,7 @@ class CronJobs
 
                // 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']]);