Cast channel and message UUIDs to string in EncryptionChannelAcknowledgeMessage
https://github.com/nosial/Socialbox-PHP/issues/14
This commit is contained in:
parent
5109796f76
commit
78c5a22c15
1 changed files with 3 additions and 17 deletions
|
@ -5,12 +5,10 @@
|
|||
use Exception;
|
||||
use Socialbox\Abstracts\Method;
|
||||
use Socialbox\Classes\Logger;
|
||||
use Socialbox\Classes\Validator;
|
||||
use Socialbox\Enums\StandardError;
|
||||
use Socialbox\Enums\Status\EncryptionChannelStatus;
|
||||
use Socialbox\Exceptions\DatabaseOperationException;
|
||||
use Socialbox\Exceptions\RpcException;
|
||||
use Socialbox\Exceptions\Standard\InvalidRpcArgumentException;
|
||||
use Socialbox\Exceptions\Standard\MissingRpcArgumentException;
|
||||
use Socialbox\Exceptions\Standard\StandardRpcException;
|
||||
use Socialbox\Interfaces\SerializableInterface;
|
||||
|
@ -32,23 +30,11 @@
|
|||
{
|
||||
throw new MissingRpcArgumentException('channel_uuid');
|
||||
}
|
||||
elseif(!Validator::validateUuid($rpcRequest->getParameter('channel_uuid')))
|
||||
{
|
||||
throw new InvalidRpcArgumentException('channel_uuid', 'The given channel uuid is not a valid UUID V4');
|
||||
}
|
||||
|
||||
if(!$rpcRequest->containsParameter('message_uuid'))
|
||||
{
|
||||
throw new MissingRpcArgumentException('message_uuid');
|
||||
}
|
||||
elseif(!is_string($rpcRequest->getParameter('message_uuid')))
|
||||
{
|
||||
throw new InvalidRpcArgumentException('message_uuid', 'Must be type string');
|
||||
}
|
||||
elseif(!Validator::validateUuid($rpcRequest->getParameter('message_uuid')))
|
||||
{
|
||||
throw new InvalidRpcArgumentException('message_uuid', 'Invalid message UUID V4');
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -177,7 +163,7 @@
|
|||
}
|
||||
|
||||
EncryptionChannelManager::acknowledgeMessage(
|
||||
$rpcRequest->getParameter('channel_uuid'), $rpcRequest->getParameter('message_uuid')
|
||||
(string)$rpcRequest->getParameter('channel_uuid'), (string)$rpcRequest->getParameter('message_uuid')
|
||||
);
|
||||
}
|
||||
catch(DatabaseOperationException $e)
|
||||
|
@ -191,8 +177,8 @@
|
|||
{
|
||||
$rpcClient = Socialbox::getExternalSession($message->getOwner($encryptionChannel)->getDomain());
|
||||
$rpcClient->encryptionChannelAcknowledgeMessage(
|
||||
channelUuid: $rpcRequest->getParameter('channel_uuid'),
|
||||
messageUuid: $rpcRequest->getParameter('message_uuid'),
|
||||
channelUuid: (string)$rpcRequest->getParameter('channel_uuid'),
|
||||
messageUuid: (string)$rpcRequest->getParameter('message_uuid'),
|
||||
identifiedAs: $requestingPeer->getAddress()
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue