From 831f6cc8e2f6955055ed00fb1e44c867cb908ddd Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 30 Jan 2025 00:34:05 -0500 Subject: [PATCH] Updated logic --- .../StandardMethods/AddressBook/AddressBookAddContact.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Socialbox/Classes/StandardMethods/AddressBook/AddressBookAddContact.php b/src/Socialbox/Classes/StandardMethods/AddressBook/AddressBookAddContact.php index 30538d2..3bf7671 100644 --- a/src/Socialbox/Classes/StandardMethods/AddressBook/AddressBookAddContact.php +++ b/src/Socialbox/Classes/StandardMethods/AddressBook/AddressBookAddContact.php @@ -20,7 +20,8 @@ class AddressBookAddContact extends Method { /** - * Adds a contact to the authenticated peer's address book + * Adds a contact to the authenticated peer's address book, returns True if the contact was added + * false if the contact already exists. * * @inheritDoc */ @@ -67,7 +68,7 @@ // Check if the contact already exists if(ContactManager::isContact($peer, $address)) { - return $rpcRequest->produceError(StandardError::FORBIDDEN, 'Contact already exists'); + return $rpcRequest->produceResponse(false); } // Create the contact