]> git.mxchange.org Git - friendica.git/commitdiff
Simplify contact search
authorMichael <heluecht@pirati.ca>
Wed, 5 Aug 2020 12:35:38 +0000 (12:35 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 5 Aug 2020 12:35:38 +0000 (12:35 +0000)
src/Protocol/Diaspora.php

index feb1111443a4bcb06324853eaeb0d3bbc66489e8..5e4ed9ee17e6daed9293ac7667334eb6f1771eda 100644 (file)
@@ -1106,20 +1106,7 @@ class Diaspora
         */
        private static function contactByHandle($uid, $handle)
        {
-               $cid = Contact::getIdForURL($handle, $uid);
-               if (!$cid) {
-                       Logger::log("Haven't found a contact for user " . $uid . " and handle " . $handle, Logger::DEBUG);
-                       return false;
-               }
-
-               $contact = DBA::selectFirst('contact', [], ['id' => $cid]);
-               if (!DBA::isResult($contact)) {
-                       // This here shouldn't happen at all
-                       Logger::log("Haven't found a contact for user " . $uid . " and handle " . $handle, Logger::DEBUG);
-                       return false;
-               }
-
-               return $contact;
+               return Contact::getByURL($handle, null, [], $uid);
        }
 
        /**