Simplify contact search

2022.09-rc
Michael 2020-08-05 12:35:38 +00:00
rodzic 2280f52945
commit 1f164f66f4
1 zmienionych plików z 1 dodań i 14 usunięć

Wyświetl plik

@ -1106,20 +1106,7 @@ class Diaspora
*/ */
private static function contactByHandle($uid, $handle) private static function contactByHandle($uid, $handle)
{ {
$cid = Contact::getIdForURL($handle, $uid); return Contact::getByURL($handle, null, [], $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;
} }
/** /**