From c87d4b0bc7cd17c1c3f086f4fb13a081f08ee082 Mon Sep 17 00:00:00 2001 From: Alma Armas Date: Tue, 29 Sep 2020 13:04:41 -0700 Subject: [PATCH] Allow users to send messages to themselves using VK API --- VKAPI/Handlers/Messages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VKAPI/Handlers/Messages.php b/VKAPI/Handlers/Messages.php index 12255667..75034d91 100644 --- a/VKAPI/Handlers/Messages.php +++ b/VKAPI/Handlers/Messages.php @@ -96,7 +96,7 @@ final class Messages extends VKAPIRequestHandler if(!$peer) $this->fail(936, "There is no peer with this id"); - if($peer->getSubscriptionStatus($this->getUser()) !== 3) + if($this->getUser()->getId() !== $peer->getId() && $peer->getSubscriptionStatus($this->getUser()) !== 3) $this->fail(945, "This chat is disabled because of privacy settings"); # Finally we get to send a message!