diff --git a/src/Socialbox/Classes/StandardMethods/AddressBook/AddressBookAddContact.php b/src/Socialbox/Classes/StandardMethods/AddressBook/AddressBookAddContact.php index 333fcf8..e34d680 100644 --- a/src/Socialbox/Classes/StandardMethods/AddressBook/AddressBookAddContact.php +++ b/src/Socialbox/Classes/StandardMethods/AddressBook/AddressBookAddContact.php @@ -65,11 +65,11 @@ // Check if the contact already exists if(ContactManager::isContact($peer, $peerAddress)) { - return $rpcRequest->produceError(StandardError::FORBIDDEN, 'Contact already exists'); + return $rpcRequest->produceResponse(false); } // Create the contact - $contactUuid = ContactManager::createContact($peer, $peerAddress, $relationship); + ContactManager::createContact($peer, $peerAddress, $relationship); } catch (DatabaseOperationException $e) { @@ -77,6 +77,6 @@ } // Return success - return $rpcRequest->produceResponse($contactUuid); + return $rpcRequest->produceResponse(true); } } \ No newline at end of file diff --git a/src/Socialbox/SocialClient.php b/src/Socialbox/SocialClient.php index e86b298..0377016 100644 --- a/src/Socialbox/SocialClient.php +++ b/src/Socialbox/SocialClient.php @@ -194,10 +194,10 @@ * * @param PeerAddress|string $peer The address of the peer to add as a contact * @param string|ContactRelationshipType|null $relationship Optional. The relationship for the peer - * @return string Returns the contact uuid if the contact was created, False if it already exists + * @return bool Returns the contact uuid if the contact was created, False if it already exists * @throws RpcException Thrown if there was an error with the RPC request */ - public function addressBookAddContact(PeerAddress|string $peer, null|string|ContactRelationshipType $relationship=ContactRelationshipType::MUTUAL): string + public function addressBookAddContact(PeerAddress|string $peer, null|string|ContactRelationshipType $relationship=ContactRelationshipType::MUTUAL): bool { if($peer instanceof PeerAddress) {