X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fping.php;h=6b3b015ac80e32bcc09839dad0d5e534ea826061;hb=59c42a92375b21028cc286bb991cc159c1c8ecf3;hp=dd57ba34d68eb3308fb3ca8847b038333410723b;hpb=92692218255145124fb553d6b61d1d9fed27da19;p=friendica.git diff --git a/mod/ping.php b/mod/ping.php index dd57ba34d6..6b3b015ac8 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -1,6 +1,22 @@ . + * */ use Friendica\App; @@ -13,6 +29,9 @@ use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Group; use Friendica\Model\Item; +use Friendica\Model\Notify\Type; +use Friendica\Model\Verb; +use Friendica\Protocol\Activity; use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; use Friendica\Util\Proxy as ProxyUtils; @@ -117,9 +136,10 @@ function ping_init(App $a) $notifs = ping_get_notifications(local_user()); - $condition = ["`unseen` AND `uid` = ? AND `contact-id` != ?", local_user(), local_user()]; + $condition = ["`unseen` AND `uid` = ? AND `contact-id` != ? AND (`vid` != ? OR `vid` IS NULL)", + local_user(), local_user(), Verb::getID(Activity::FOLLOW)]; $fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar', - 'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid', 'wall']; + 'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid', 'wall', 'activity']; $params = ['order' => ['received' => true]]; $items = Item::selectForUser(local_user(), $fields, $condition, $params); @@ -403,8 +423,8 @@ function ping_get_notifications($uid) AND NOT (`notify`.`type` IN (%d, %d)) AND $seensql `notify`.`seen` ORDER BY `notify`.`date` $order LIMIT %d, 50", intval($uid), - intval(NOTIFY_INTRO), - intval(NOTIFY_MAIL), + intval(Type::INTRO), + intval(Type::MAIL), intval($offset) ); @@ -443,17 +463,17 @@ function ping_get_notifications($uid) ); } - $notification["href"] = DI::baseUrl() . "/notification/view/" . $notification["id"]; + $notification["href"] = DI::baseUrl() . "/notification/" . $notification["id"]; if ($notification["visible"] && !$notification["deleted"] - && empty($result[$notification["parent"]]) + && empty($result[$notification['parent']]) ) { // Should we condense the notifications or show them all? if (DI::pConfig()->get(local_user(), 'system', 'detailed_notif')) { $result[$notification["id"]] = $notification; } else { - $result[$notification["parent"]] = $notification; + $result[$notification['parent']] = $notification; } } }