]> git.mxchange.org Git - friendica.git/blobdiff - src/Factory/Notification/Introduction.php
Fix notices
[friendica.git] / src / Factory / Notification / Introduction.php
index a16926f9670af9648403bc46beb7576aedeba109..aacb0b7783d690c110dc2b2ef5418070ed513709 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -115,10 +115,17 @@ class Introduction extends BaseFactory
                        );
 
                        while ($notification = $this->dba->fetch($stmtNotifications)) {
-                               // There are two kind of introduction. Contacts suggested by other contacts and normal connection requests.
+                               if (empty($notification['url'])) {
+                                       continue;
+                               }
+
+                       // There are two kind of introduction. Contacts suggested by other contacts and normal connection requests.
                                // We have to distinguish between these two because they use different data.
                                // Contact suggestions
                                if ($notification['fid'] ?? '') {
+                                       if (empty($notification['furl'])) {
+                                               continue;
+                                       }
                                        $return_addr = bin2hex($this->nick . '@' .
                                                               $this->baseUrl->getHostName() .
                                                               (($this->baseUrl->getURLPath()) ? '/' . $this->baseUrl->getURLPath() : ''));
@@ -132,7 +139,7 @@ class Introduction extends BaseFactory
                                                'madeby_zrl'     => Contact::magicLink($notification['url']),
                                                'madeby_addr'    => $notification['addr'],
                                                'contact_id'     => $notification['contact-id'],
-                                               'photo'          => (!empty($notification['fphoto']) ? Proxy::proxifyUrl($notification['fphoto'], false, Proxy::SIZE_SMALL) : "images/person-300.jpg"),
+                                               'photo'          => (!empty($notification['fphoto']) ? Proxy::proxifyUrl($notification['fphoto'], false, Proxy::SIZE_SMALL) : Contact::DEFAULT_AVATAR_PHOTO),
                                                'name'           => $notification['fname'],
                                                'url'            => $notification['furl'],
                                                'zrl'            => Contact::magicLink($notification['furl']),
@@ -143,10 +150,6 @@ class Introduction extends BaseFactory
 
                                        // Normal connection requests
                                } else {
-                                       if (empty($notification['url'])) {
-                                               continue;
-                                       }
-
                                        // Don't show these data until you are connected. Diaspora is doing the same.
                                        if ($notification['network'] === Protocol::DIASPORA) {
                                                $notification['location'] = "";