]> git.mxchange.org Git - friendica.git/commitdiff
Issue 4655: Avoid multiplicated contact requests from the same account
authorMichael <heluecht@pirati.ca>
Wed, 18 Apr 2018 05:02:59 +0000 (05:02 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 18 Apr 2018 05:02:59 +0000 (05:02 +0000)
src/Model/Contact.php

index eeecac1465ee60da6e9cd623988d0b52839c414f..48e8be31069307e5272c9dcbdd10f01eca8c8a7d 100644 (file)
@@ -1482,6 +1482,11 @@ class Contact extends BaseObject
                        }
                        // send email notification to owner?
                } else {
+                       if (dba::exists('contact', ['nurl' => normalise_link($url), 'uid' => $importer['uid'], 'pending' => true])) {
+                               logger('ignoring duplicated connection request from pending contact ' . $url);
+                               return;
+                       }
+
                        // create contact record
                        q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `name`, `nick`, `photo`, `network`, `rel`,
                                `blocked`, `readonly`, `pending`, `writable`)