Use Contact::getDetailsByURL instead of custom query in Protocol\OStatus

- Address part of https://github.com/friendica/friendica/issues/8475#issuecomment-646457104
pull/8790/head
Hypolite Petovan 2020-06-19 07:10:39 -04:00
rodzic aafef02789
commit a83681e93a
1 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -2087,10 +2087,9 @@ class OStatus
$mentioned = $newmentions;
foreach ($mentioned as $mention) {
$condition = ['uid' => $owner['uid'], 'nurl' => Strings::normaliseLink($mention)];
$contact = DBA::selectFirst('contact', ['forum', 'prv', 'self', 'contact-type'], $condition);
if ($contact["forum"] || $contact["prv"] || ($owner['contact-type'] == Contact::TYPE_COMMUNITY) ||
($contact['self'] && ($owner['account-type'] == User::ACCOUNT_TYPE_COMMUNITY))) {
$contact = Contact::getDetailsByURL($mention, $owner['uid']);
if (!empty($contact) && ($contact["forum"] || $contact["prv"] || ($owner['contact-type'] == Contact::TYPE_COMMUNITY) ||
($contact['self'] && ($owner['account-type'] == User::ACCOUNT_TYPE_COMMUNITY)))) {
XML::addElement($doc, $entry, "link", "",
[
"rel" => "mentioned",