X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FOStatus.php;h=81e5c19db8cc42d73eaf2c5e7adc2f2f74c2cb53;hb=8a0c568fe103e2e7ef832a623bfb6be6c54e300a;hp=38105e452a929dbdf589675964837c4b7e4c39cb;hpb=abf9056449f8e32797bd1d1f7055e555e79de710;p=friendica.git diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 38105e452a..81e5c19db8 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -417,13 +417,6 @@ class OStatus $author = self::fetchAuthor($xpath, $entry, $importer, $contact, $stored); } - $value = XML::getFirstNodeValue($xpath, 'atom:author/poco:preferredUsername/text()', $entry); - if ($value != "") { - $nickname = $value; - } else { - $nickname = $author["author-name"]; - } - $item = array_merge($header, $author); $item["uri"] = XML::getFirstNodeValue($xpath, 'atom:id/text()', $entry); @@ -463,7 +456,7 @@ class OStatus } if ($item["verb"] == ACTIVITY_FOLLOW) { - Contact::addRelationship($importer, $contact, $item, $nickname); + Contact::addRelationship($importer, $contact, $item); continue; } @@ -1515,7 +1508,7 @@ class OStatus $author->appendChild($urls); } - XML::addElement($doc, $author, "followers", "", ["url" => System::baseUrl()."/viewcontacts/".$owner["nick"]]); + XML::addElement($doc, $author, "followers", "", ["url" => System::baseUrl() . "/profile/" . $owner["nick"] . "/contacts/followers"]); XML::addElement($doc, $author, "statusnet:profile_info", "", ["local_id" => $owner["uid"]]); if ($profile["publish"]) { @@ -1763,19 +1756,16 @@ class OStatus $verb = NAMESPACE_ACTIVITY_SCHEMA."favorite"; self::entryContent($doc, $entry, $item, $owner, "Favorite", $verb, false); - $as_object = $doc->createElement("activity:object"); - $parent = Item::selectFirst([], ['uri' => $item["thr-parent"], 'uid' => $item["uid"]]); + if (DBA::isResult($parent)) { + $as_object = $doc->createElement("activity:object"); - if (!$parent) { - $parent = []; - } - - XML::addElement($doc, $as_object, "activity:object-type", self::constructObjecttype($parent)); + XML::addElement($doc, $as_object, "activity:object-type", self::constructObjecttype($parent)); - self::entryContent($doc, $as_object, $parent, $owner, "New entry"); + self::entryContent($doc, $as_object, $parent, $owner, "New entry"); - $entry->appendChild($as_object); + $entry->appendChild($as_object); + } self::entryFooter($doc, $entry, $item, $owner);