From f080775701cc2be1dfcc567527b5e9055644ca69 Mon Sep 17 00:00:00 2001 From: netkas Date: Sat, 22 Mar 2025 01:00:20 -0400 Subject: [PATCH] Add signatureExists method to Contact class and remove unused Cryptography import in ContactManager --- src/Socialbox/Managers/ContactManager.php | 1 - src/Socialbox/Objects/Standard/Contact.php | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Socialbox/Managers/ContactManager.php b/src/Socialbox/Managers/ContactManager.php index 2401f1c..a1f35dc 100644 --- a/src/Socialbox/Managers/ContactManager.php +++ b/src/Socialbox/Managers/ContactManager.php @@ -8,7 +8,6 @@ use PDO; use PDOException; use Socialbox\Classes\Configuration; - use Socialbox\Classes\Cryptography; use Socialbox\Classes\Database; use Socialbox\Classes\Validator; use Socialbox\Enums\Types\ContactRelationshipType; diff --git a/src/Socialbox/Objects/Standard/Contact.php b/src/Socialbox/Objects/Standard/Contact.php index 4d56f5a..d259177 100644 --- a/src/Socialbox/Objects/Standard/Contact.php +++ b/src/Socialbox/Objects/Standard/Contact.php @@ -89,6 +89,18 @@ return $this->knownKeys; } + public function signatureExists(string $signatureUuid): bool + { + foreach($this->knownKeys as $key) + { + if($key->getUuid() === $signatureUuid) + { + return true; + } + } + return false; + } + /** * Retrieves the timestamp when the contact was added. *