Add text field to Message object (#519)

Resolves #518
This commit is contained in:
E2r7hN07Fl47 2022-03-27 20:12:05 +03:00 committed by GitHub
parent c8b154d87a
commit 4482661848
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -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;

View file

@ -11,6 +11,7 @@ final class Message
public $out;
public $title = "";
public $body;
public $text;
public $attachments = [];
public $fwd_messages = [];
public $emoji;