From d9ec6a169273ba744bd113ff9b4b7d4688a486b1 Mon Sep 17 00:00:00 2001 From: El psy congroo desu <94683384+el-psy-congroo-desu@users.noreply.github.com> Date: Mon, 29 Aug 2022 01:49:01 +0500 Subject: [PATCH] VKAPI: Messages.getHistory return profile of message owners (#700) --- VKAPI/Handlers/Messages.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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