Renamed function
This commit is contained in:
parent
d4f7bfa676
commit
2cbc935944
|
@ -40,7 +40,7 @@ class FContact
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
*/
|
*/
|
||||||
public static function getByUrl($handle, $update = null)
|
public static function getByURL($handle, $update = null)
|
||||||
{
|
{
|
||||||
$person = DBA::selectFirst('fcontact', [], ['network' => Protocol::DIASPORA, 'addr' => $handle]);
|
$person = DBA::selectFirst('fcontact', [], ['network' => Protocol::DIASPORA, 'addr' => $handle]);
|
||||||
if (!DBA::isResult($person)) {
|
if (!DBA::isResult($person)) {
|
||||||
|
@ -77,7 +77,7 @@ class FContact
|
||||||
if ($r && ($r["network"] === Protocol::DIASPORA)) {
|
if ($r && ($r["network"] === Protocol::DIASPORA)) {
|
||||||
self::updateFContact($r);
|
self::updateFContact($r);
|
||||||
|
|
||||||
$person = self::getByUrl($handle, false);
|
$person = self::getByURL($handle, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1410,7 +1410,7 @@ class DFRN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$fcontact = FContact::getByUrl($contact['addr']);
|
$fcontact = FContact::getByURL($contact['addr']);
|
||||||
if (empty($fcontact)) {
|
if (empty($fcontact)) {
|
||||||
Logger::log('Unable to find contact details for ' . $contact['id'] . ' - ' . $contact['addr']);
|
Logger::log('Unable to find contact details for ' . $contact['id'] . ' - ' . $contact['addr']);
|
||||||
return -22;
|
return -22;
|
||||||
|
|
|
@ -937,7 +937,7 @@ class Diaspora
|
||||||
|
|
||||||
Logger::log("Fetching diaspora key for: ".$handle);
|
Logger::log("Fetching diaspora key for: ".$handle);
|
||||||
|
|
||||||
$r = FContact::getByUrl($handle);
|
$r = FContact::getByURL($handle);
|
||||||
if ($r) {
|
if ($r) {
|
||||||
return $r["pubkey"];
|
return $r["pubkey"];
|
||||||
}
|
}
|
||||||
|
@ -1020,7 +1020,7 @@ class Diaspora
|
||||||
*/
|
*/
|
||||||
public static function isSupportedByContactUrl($url, $update = null)
|
public static function isSupportedByContactUrl($url, $update = null)
|
||||||
{
|
{
|
||||||
return !empty(FContact::getByUrl($url, $update));
|
return !empty(FContact::getByURL($url, $update));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1379,7 +1379,7 @@ class Diaspora
|
||||||
$item = Item::selectFirst($fields, $condition);
|
$item = Item::selectFirst($fields, $condition);
|
||||||
|
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
$person = FContact::getByUrl($author);
|
$person = FContact::getByURL($author);
|
||||||
$result = self::storeByGuid($guid, $person["url"], $uid);
|
$result = self::storeByGuid($guid, $person["url"], $uid);
|
||||||
|
|
||||||
// We don't have an url for items that arrived at the public dispatcher
|
// We don't have an url for items that arrived at the public dispatcher
|
||||||
|
@ -1602,7 +1602,7 @@ class Diaspora
|
||||||
if (DBA::isResult($item)) {
|
if (DBA::isResult($item)) {
|
||||||
return $item["uri"];
|
return $item["uri"];
|
||||||
} elseif (!$onlyfound) {
|
} elseif (!$onlyfound) {
|
||||||
$person = FContact::getByUrl($author);
|
$person = FContact::getByURL($author);
|
||||||
|
|
||||||
$parts = parse_url($person['url']);
|
$parts = parse_url($person['url']);
|
||||||
unset($parts['path']);
|
unset($parts['path']);
|
||||||
|
@ -1658,7 +1658,7 @@ class Diaspora
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$person = FContact::getByUrl($match[3]);
|
$person = FContact::getByURL($match[3]);
|
||||||
if (empty($person)) {
|
if (empty($person)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1714,7 +1714,7 @@ class Diaspora
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$person = FContact::getByUrl($author);
|
$person = FContact::getByURL($author);
|
||||||
if (!is_array($person)) {
|
if (!is_array($person)) {
|
||||||
Logger::log("unable to find author details");
|
Logger::log("unable to find author details");
|
||||||
return false;
|
return false;
|
||||||
|
@ -1829,7 +1829,7 @@ class Diaspora
|
||||||
$body = Markdown::toBBCode($msg_text);
|
$body = Markdown::toBBCode($msg_text);
|
||||||
$message_uri = $msg_author.":".$msg_guid;
|
$message_uri = $msg_author.":".$msg_guid;
|
||||||
|
|
||||||
$person = FContact::getByUrl($msg_author);
|
$person = FContact::getByURL($msg_author);
|
||||||
|
|
||||||
return Mail::insert([
|
return Mail::insert([
|
||||||
'uid' => $importer['uid'],
|
'uid' => $importer['uid'],
|
||||||
|
@ -1946,7 +1946,7 @@ class Diaspora
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$person = FContact::getByUrl($author);
|
$person = FContact::getByURL($author);
|
||||||
if (!is_array($person)) {
|
if (!is_array($person)) {
|
||||||
Logger::log("unable to find author details");
|
Logger::log("unable to find author details");
|
||||||
return false;
|
return false;
|
||||||
|
@ -2052,7 +2052,7 @@ class Diaspora
|
||||||
|
|
||||||
$message_uri = $author.":".$guid;
|
$message_uri = $author.":".$guid;
|
||||||
|
|
||||||
$person = FContact::getByUrl($author);
|
$person = FContact::getByURL($author);
|
||||||
if (!$person) {
|
if (!$person) {
|
||||||
Logger::log("unable to find author details");
|
Logger::log("unable to find author details");
|
||||||
return false;
|
return false;
|
||||||
|
@ -2118,7 +2118,7 @@ class Diaspora
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$person = FContact::getByUrl($author);
|
$person = FContact::getByURL($author);
|
||||||
if (!is_array($person)) {
|
if (!is_array($person)) {
|
||||||
Logger::log("Person not found: ".$author);
|
Logger::log("Person not found: ".$author);
|
||||||
return false;
|
return false;
|
||||||
|
@ -2392,7 +2392,7 @@ class Diaspora
|
||||||
Logger::log("Author ".$author." wants to listen to us.", Logger::DEBUG);
|
Logger::log("Author ".$author." wants to listen to us.", Logger::DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = FContact::getByUrl($author);
|
$ret = FContact::getByURL($author);
|
||||||
|
|
||||||
if (!$ret || ($ret["network"] != Protocol::DIASPORA)) {
|
if (!$ret || ($ret["network"] != Protocol::DIASPORA)) {
|
||||||
Logger::log("Cannot resolve diaspora handle ".$author." for ".$recipient);
|
Logger::log("Cannot resolve diaspora handle ".$author." for ".$recipient);
|
||||||
|
@ -2680,7 +2680,7 @@ class Diaspora
|
||||||
$target_guid = Strings::escapeTags(XML::unescape($data->target_guid));
|
$target_guid = Strings::escapeTags(XML::unescape($data->target_guid));
|
||||||
$target_type = Strings::escapeTags(XML::unescape($data->target_type));
|
$target_type = Strings::escapeTags(XML::unescape($data->target_type));
|
||||||
|
|
||||||
$person = FContact::getByUrl($author);
|
$person = FContact::getByURL($author);
|
||||||
if (!is_array($person)) {
|
if (!is_array($person)) {
|
||||||
Logger::log("unable to find author detail for ".$author);
|
Logger::log("unable to find author detail for ".$author);
|
||||||
return false;
|
return false;
|
||||||
|
@ -3083,7 +3083,7 @@ class Diaspora
|
||||||
// We always try to use the data from the fcontact table.
|
// We always try to use the data from the fcontact table.
|
||||||
// This is important for transmitting data to Friendica servers.
|
// This is important for transmitting data to Friendica servers.
|
||||||
if (!empty($contact['addr'])) {
|
if (!empty($contact['addr'])) {
|
||||||
$fcontact = FContact::getByUrl($contact['addr']);
|
$fcontact = FContact::getByURL($contact['addr']);
|
||||||
if (!empty($fcontact)) {
|
if (!empty($fcontact)) {
|
||||||
$dest_url = ($public_batch ? $fcontact["batch"] : $fcontact["notify"]);
|
$dest_url = ($public_batch ? $fcontact["batch"] : $fcontact["notify"]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,7 +268,7 @@ class Delivery
|
||||||
private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup)
|
private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup)
|
||||||
{
|
{
|
||||||
// Transmit Diaspora reshares via Diaspora if the Friendica contact support Diaspora
|
// Transmit Diaspora reshares via Diaspora if the Friendica contact support Diaspora
|
||||||
if (Diaspora::isReshare($target_item['body']) && !empty(FContact::getByUrl($contact['addr'], false))) {
|
if (Diaspora::isReshare($target_item['body']) && !empty(FContact::getByURL($contact['addr'], false))) {
|
||||||
Logger::info('Reshare will be transmitted via Diaspora', ['url' => $contact['url'], 'guid' => ($target_item['guid'] ?? '') ?: $target_item['id']]);
|
Logger::info('Reshare will be transmitted via Diaspora', ['url' => $contact['url'], 'guid' => ($target_item['guid'] ?? '') ?: $target_item['id']]);
|
||||||
self::deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup);
|
self::deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user