- $local_time = DateTimeFormat::local($notif['date']);
-
- $notifications[] = [
- 'id' => $notif['id'],
- 'href' => $notif['href'],
- 'name' => $notif['name'],
- 'url' => $notif['url'],
- 'photo' => $notif['photo'],
- 'date' => Temporal::getRelativeDate($notif['date']),
- 'message' => $notif['message'],
- 'seen' => $notif['seen'],
- 'timestamp' => strtotime($local_time)
- ];
- }
- }
+ array_walk($notifications, function (&$notification) {
+ $notification['photo'] = Contact::getAvatarUrlForUrl($notification['url'], local_user(), Proxy::SIZE_MICRO);
+ $notification['timestamp'] = DateTimeFormat::local($notification['date']);
+ $notification['date'] = Temporal::getRelativeDate($notification['date']);
+ });