From a9e5d6eb460b6a1114118642dcafb186c8f54526 Mon Sep 17 00:00:00 2001 From: netkas Date: Mon, 27 Jan 2025 02:34:54 -0500 Subject: [PATCH] Added check for adding self as a contact --- src/Socialbox/SocialClient.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Socialbox/SocialClient.php b/src/Socialbox/SocialClient.php index 252b9ee..0be51e7 100644 --- a/src/Socialbox/SocialClient.php +++ b/src/Socialbox/SocialClient.php @@ -572,17 +572,22 @@ * @return Peer The resolved peer object. * @throws RpcException Thrown if the RPC request fails. */ - public function resolvePeer(string|PeerAddress $peerAddress): Peer + public function resolvePeer(string|PeerAddress $peerAddress, null|string|PeerAddress $identifiedAs=null): Peer { if($peerAddress instanceof PeerAddress) { $peerAddress = $peerAddress->getAddress(); } + if($identifiedAs instanceof PeerAddress) + { + $identifiedAs = $identifiedAs->getAddress(); + } + return Peer::fromArray($this->sendRequest( new RpcRequest(StandardMethods::RESOLVE_PEER, Utilities::randomCrc32(), [ 'peer' => $peerAddress - ]) + ]), $identifiedAs )->getResponse()->getResult()); } } \ No newline at end of file