- $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) {
+ if (empty($notification['photo'])) {
+ $contact = Contact::getByURL($notification['url'], false, ['micro', 'id', 'avatar']);
+ $notification['photo'] = Contact::getMicro($contact, $notification['photo']);