]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
version 2021.03-dev
[friendica.git] / mod / ping.php
index 1634ed725d1984fc786e8262336d8c01d3e621c1..762d0a0f8187f0d6a1b4eda6cbc8924df5360633 100644 (file)
@@ -185,7 +185,7 @@ function ping_init(App $a)
                        "SELECT `intro`.`id`, `intro`.`datetime`,
                        `contact`.`name`, `contact`.`url`, `contact`.`photo`
                        FROM `intro` INNER JOIN `contact` ON `intro`.`contact-id` = `contact`.`id`
-                       WHERE `intro`.`uid` = %d AND NOT `intro`.`blocked` AND NOT `intro`.`ignore` AND `intro`.`contact-id` != 0 AND `intro`.`fid` = 0",
+                       WHERE `intro`.`uid` = %d AND NOT `intro`.`blocked` AND NOT `intro`.`ignore` AND `intro`.`contact-id` != 0 AND (`intro`.`fid` = 0 OR `intro`.`fid` IS NULL)",
                        intval(local_user())
                );
 
@@ -301,7 +301,7 @@ function ping_init(App $a)
                                                'seen'    => false,
                                                'message' => DI::l10n()->t('{0} requested registration'),
                                        ];
-                                       $notifs[] = $notif;
+                                       $notifications[] = $notif;
                                }
                        } else {
                                $notif = [
@@ -342,10 +342,11 @@ function ping_init(App $a)
                array_walk($notifications, function (&$notification) {
                        if (empty($notification['photo'])) {
                                $contact = Contact::getByURL($notification['url'], false, ['micro', 'id', 'avatar']);
-                               $notification['photo'] = Contact::getMicro($contact, $notif['photo']);
+                               $notification['photo'] = Contact::getMicro($contact, $notification['photo']);
                        }
 
                        $notification['timestamp'] = DateTimeFormat::local($notification['date']);
+                       $notification['date'] = Temporal::getRelativeDate($notification['date']);
                });
        }