VKAPI: Messages.getHistory return profile of message owners (#700)

This commit is contained in:
El psy congroo desu 2022-08-29 01:49:01 +05:00 committed by GitHub
parent a43f5dac39
commit d9ec6a1692
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -316,10 +316,18 @@ final class Messages extends VKAPIRequestHandler
$results[] = $rMsg; $results[] = $rMsg;
} }
return (object) [ $output = [
"count" => sizeof($results), "count" => sizeof($results),
"items" => $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 function getLongPollHistory(int $ts = -1, int $preview_length = 0, int $events_limit = 1000, int $msgs_limit = 1000): object