From 44826618488994ff627cbe46bed216a277c866d4 Mon Sep 17 00:00:00 2001 From: E2r7hN07Fl47 <43937145+E2r7hN07Fl47@users.noreply.github.com> Date: Sun, 27 Mar 2022 20:12:05 +0300 Subject: [PATCH] Add text field to Message object (#519) Resolves #518 --- VKAPI/Handlers/Messages.php | 4 ++++ VKAPI/Structures/Message.php | 1 + 2 files changed, 5 insertions(+) diff --git a/VKAPI/Handlers/Messages.php b/VKAPI/Handlers/Messages.php index 441e7e46..456e31df 100644 --- a/VKAPI/Handlers/Messages.php +++ b/VKAPI/Handlers/Messages.php @@ -49,10 +49,12 @@ final class Messages extends VKAPIRequestHandler $rMsg->read_state = 1; $rMsg->out = (int) ($message->getSender()->getId() === $this->getUser()->getId()); $rMsg->body = $message->getText(false); + $rMsg->text = $message->getText(false); $rMsg->emoji = true; if($preview_length > 0) $rMsg->body = ovk_proc_strtr($rMsg->body, $preview_length); + $rMsg->text = ovk_proc_strtr($rMsg->text, $preview_length); $items[] = $rMsg; } @@ -192,6 +194,7 @@ final class Messages extends VKAPIRequestHandler $lastMessagePreview->read_state = 1; $lastMessagePreview->out = (int) ($lastMessage->getSender()->getId() === $this->getUser()->getId()); $lastMessagePreview->body = $lastMessage->getText(false); + $lastMessagePreview->text = $lastMessage->getText(false); $lastMessagePreview->emoji = true; if($extended == 1) { @@ -248,6 +251,7 @@ final class Messages extends VKAPIRequestHandler $rMsg->read_state = 1; $rMsg->out = (int) ($msgU->sender_id === $this->getUser()->getId()); $rMsg->body = $message->getText(false); + $rMsg->text = $message->getText(false); $rMsg->emoji = true; $results[] = $rMsg; diff --git a/VKAPI/Structures/Message.php b/VKAPI/Structures/Message.php index 79831f0a..ba022f3f 100644 --- a/VKAPI/Structures/Message.php +++ b/VKAPI/Structures/Message.php @@ -11,6 +11,7 @@ final class Message public $out; public $title = ""; public $body; + public $text; public $attachments = []; public $fwd_messages = []; public $emoji;