]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/OStatus.php
Bugfix: Calls to a renamed function had been changed
[friendica.git] / src / Protocol / OStatus.php
index ed762084c2668d83d55cd4e113006d9b16bf4213..2a021c89e9a3dac70fdb5cd42d857c1b6725a697 100644 (file)
@@ -9,9 +9,10 @@ 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;
@@ -24,7 +25,6 @@ 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 +151,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 +200,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 +220,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;
@@ -1326,7 +1323,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 +1343,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"],