diff --git a/VKAPI/Handlers/Messages.php b/VKAPI/Handlers/Messages.php index 5767acc4..5ecbe740 100644 --- a/VKAPI/Handlers/Messages.php +++ b/VKAPI/Handlers/Messages.php @@ -316,10 +316,18 @@ final class Messages extends VKAPIRequestHandler $results[] = $rMsg; } - return (object) [ + $output = [ "count" => sizeof($results), "items" => $results, ]; + + if ($extended == 1) { + $users[] = $this->getUser()->getId(); + $users[] = $user_id; + $output["profiles"] = (!empty($users) ? (new APIUsers($this->getUser()))->get(implode(',', $users), $fields) : []); + } + + return (object) $output; } function getLongPollHistory(int $ts = -1, int $preview_length = 0, int $events_limit = 1000, int $msgs_limit = 1000): object