getContext(); /** @var VBOChatUser[] */ $recipients = array_filter($context->getRecipients(), function($user) use ($thread) { return $user->getID() == $thread->getSenderID(); }); /** @var VBOChatUser */ $user = array_shift($recipients) ?: new VBOChatUserNull($thread->getSenderID(), $thread->getSenderName()); // obtain plain contents of last message $message = strip_tags((string) $thread->getMessage()); // stringify attachments $attachments = implode(', ', array_map(function($a) { return $a->getName(); }, $thread->getAttachments())); // thread last update $lastUpdate = $thread->getCreationDate(); $dateFormat = $options['dateformat'] ?? 'Y-m-d'; ?>