X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FOStatus.php;h=cadc9a37ea59df4618090ca9de53c2c925b287ff;hb=916236ce2fe2c0e9e48d000c6d665f96fecf00a9;hp=ed762084c2668d83d55cd4e113006d9b16bf4213;hpb=a21f6135fcd8f0bfdb49de38a5ab4954d1784503;p=friendica.git diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index ed762084c2..cadc9a37ea 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -9,22 +9,23 @@ use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\System; use Friendica\Database\DBM; -use Friendica\Model\GlobalContact; +use Friendica\Model\Contact; +use Friendica\Model\GContact; use Friendica\Network\Probe; -use Friendica\Object\Contact; +use Friendica\Object\Image; use Friendica\Util\Lock; use Friendica\Util\XML; use dba; use DOMDocument; -use DomXPath; +use DOMXPath; +require_once 'include/dba.php'; require_once 'include/threads.php'; require_once 'include/html2bbcode.php'; require_once 'include/bbcode.php'; require_once 'include/items.php'; require_once 'mod/share.php'; require_once 'include/enotify.php'; -require_once 'include/Photo.php'; require_once 'include/follow.php'; require_once 'include/api.php'; require_once 'mod/proxy.php'; @@ -151,11 +152,8 @@ class OStatus // Only update the contacts if it is an OStatus contact if ($r && ($r['id'] > 0) && !$onlyfetch && ($contact["network"] == NETWORK_OSTATUS)) { - // This contact is vital, so we awake it from the dead - Contact::unmarkForArchival($contact); // Update contact data - $current = $contact; unset($current['name-date']); @@ -203,7 +201,7 @@ class OStatus if (!empty($author["author-avatar"]) && ($author["author-avatar"] != $current['avatar'])) { logger("Update profile picture for contact ".$contact["id"], LOGGER_DEBUG); - update_contact_avatar($author["author-avatar"], $importer["uid"], $contact["id"]); + Contact::updateAvatar($author["author-avatar"], $importer["uid"], $contact["id"]); } // Ensure that we are having this contact (with uid=0) @@ -223,15 +221,15 @@ class OStatus dba::update('contact', $fields, array('id' => $cid), $old_contact); // Update the avatar - update_contact_avatar($author["author-avatar"], 0, $cid); + Contact::updateAvatar($author["author-avatar"], 0, $cid); } $contact["generation"] = 2; $contact["hide"] = false; // OStatus contacts are never hidden $contact["photo"] = $author["author-avatar"]; - $gcid = GlobalContact::update($contact); + $gcid = GContact::update($contact); - GlobalContact::link($gcid, $contact["uid"], $contact["id"]); + GContact::link($gcid, $contact["uid"], $contact["id"]); } return $author; @@ -254,7 +252,7 @@ class OStatus $doc = new DOMDocument(); @$doc->loadXML($xml); - $xpath = new DomXPath($doc); + $xpath = new DOMXPath($doc); $xpath->registerNamespace('atom', NAMESPACE_ATOM1); $xpath->registerNamespace('thr', NAMESPACE_THREAD); $xpath->registerNamespace('georss', NAMESPACE_GEORSS); @@ -332,7 +330,7 @@ class OStatus $doc = new DOMDocument(); @$doc->loadXML($xml); - $xpath = new DomXPath($doc); + $xpath = new DOMXPath($doc); $xpath->registerNamespace('atom', NAMESPACE_ATOM1); $xpath->registerNamespace('thr', NAMESPACE_THREAD); $xpath->registerNamespace('georss', NAMESPACE_GEORSS); @@ -742,7 +740,7 @@ class OStatus if (!@$doc->loadHTML($conversation_data['body'])) { return; } - $xpath = new DomXPath($doc); + $xpath = new DOMXPath($doc); $links = $xpath->query('//link'); if ($links) { @@ -782,7 +780,7 @@ class OStatus $doc = new DOMDocument(); @$doc->loadXML($xml); - $xpath = new DomXPath($doc); + $xpath = new DOMXPath($doc); $xpath->registerNamespace('atom', NAMESPACE_ATOM1); $xpath->registerNamespace('thr', NAMESPACE_THREAD); $xpath->registerNamespace('ostatus', NAMESPACE_OSTATUS); @@ -932,7 +930,7 @@ class OStatus if (!@$doc->loadHTML($related_data['body'])) { return; } - $xpath = new DomXPath($doc); + $xpath = new DOMXPath($doc); $atom_file = ''; @@ -1326,7 +1324,7 @@ class OStatus switch ($siteinfo["type"]) { case 'photo': - $imgdata = get_photo_info($siteinfo["image"]); + $imgdata = Image::getInfoFromURL($siteinfo["image"]); $attributes = array("rel" => "enclosure", "href" => $siteinfo["image"], "type" => $imgdata["mime"], @@ -1346,7 +1344,7 @@ class OStatus } if (!Config::get('system', 'ostatus_not_attach_preview') && ($siteinfo["type"] != "photo") && isset($siteinfo["image"])) { - $imgdata = get_photo_info($siteinfo["image"]); + $imgdata = Image::getInfoFromURL($siteinfo["image"]); $attributes = array("rel" => "enclosure", "href" => $siteinfo["image"], "type" => $imgdata["mime"],