containsParameter('peer')) { return $rpcRequest->produceError(StandardError::RPC_INVALID_ARGUMENTS, 'Missing required peer parameter'); } try { $address = PeerAddress::fromAddress($rpcRequest->getParameter('peer')); } catch(InvalidArgumentException $e) { throw new StandardException('Invalid peer address', StandardError::RPC_INVALID_ARGUMENTS, $e); } if(!$rpcRequest->containsParameter('uuid')) { return $rpcRequest->produceError(StandardError::RPC_INVALID_ARGUMENTS, "Missing 'uuid' parameter"); } try { $uuid = Uuid::fromString($rpcRequest->getParameter('uuid')); } catch(InvalidArgumentException $e) { throw new StandardException('Invalid UUID', StandardError::RPC_INVALID_ARGUMENTS, $e); } try { // Check if the contact already exists $peer = $request->getPeer(); if(ContactManager::isContact($peer, $address)) { } // Create the contact ContactManager::updateContactRelationship($peer, $address, $relationship); } catch (DatabaseOperationException $e) { throw new StandardException('Failed to update contact relationship', StandardError::INTERNAL_SERVER_ERROR, $e); } // Return success return $rpcRequest->produceResponse(true); } }