X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FOStatus.php;h=d56bacc67512d45fd81561ed189657bc08ed8a53;hb=3c9b33176f52790ff669ec2f2e28ed350a3944c8;hp=7052205e1706b57f55689a15865bbb40998efed9;hpb=7f3fb34c24e30b79d8c25f63dbb2c3c3da79e599;p=friendica.git diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 7052205e17..d56bacc675 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -74,6 +74,16 @@ class OStatus $author["contact-id"] = $contact["id"]; $contact = null; + +/* + This here would be better, but we would get problems with contacts from the statusnet addon + This is kept here as a reminder for the future + + $cid = Contact::getIdForURL($author["author-link"], $importer["uid"]); + if ($cid) { + $contact = DBA::selectFirst('contact', [], ['id' => $cid]); + } +*/ if ($aliaslink != '') { $condition = ["`uid` = ? AND `alias` = ? AND `network` != ? AND `rel` IN (?, ?)", $importer["uid"], $aliaslink, Protocol::STATUSNET, @@ -219,7 +229,7 @@ class OStatus $gcid = GContact::update($contact); GContact::link($gcid, $contact["uid"], $contact["id"]); - } else { + } elseif ($contact["network"] != Protocol::DFRN) { $contact = null; } @@ -312,7 +322,7 @@ class OStatus self::$conv_list = []; } - logger("Import OStatus message", LOGGER_DEBUG); + logger('Import OStatus message for user ' . $importer['uid'], LOGGER_DEBUG); if ($xml == "") { return false; @@ -351,7 +361,7 @@ class OStatus $header["origin"] = 0; $header["gravity"] = GRAVITY_COMMENT; - if (!is_object($doc->firstChild)) { + if (!is_object($doc->firstChild) || empty($doc->firstChild->tagName)) { return false; } @@ -1994,8 +2004,7 @@ class OStatus } if (intval($item["parent"]) > 0) { - $conversation_href = System::baseUrl()."/display/".$owner["nick"]."/".$item["parent"]; - $conversation_uri = $conversation_href; + $conversation_href = $conversation_uri = str_replace('/objects/', '/context/', $item['parent-uri']); if (isset($parent_item)) { $conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $parent_item]);