VKAPI: Allow sending messages not only to friends

Modification taken from e5c650e351
I hope it works properly
This commit is contained in:
Ilya Prokopenko 2022-07-24 15:07:26 +07:00
parent 5bced47724
commit 75030bfdc4
No known key found for this signature in database
GPG key ID: 7736BBBB05F14A56

View file

@ -99,7 +99,7 @@ final class Messages extends VKAPIRequestHandler
if(!$peer) if(!$peer)
$this->fail(936, "There is no peer with this id"); $this->fail(936, "There is no peer with this id");
if($this->getUser()->getId() !== $peer->getId() && $peer->getSubscriptionStatus($this->getUser()) !== 3) if($this->getUser()->getId() !== $peer->getId() && !$peer->getPrivacyPermission('messages.write', $this->getUser()))
$this->fail(945, "This chat is disabled because of privacy settings"); $this->fail(945, "This chat is disabled because of privacy settings");
# Finally we get to send a message! # Finally we get to send a message!