]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/OStatus.php
Merge remote-tracking branch 'upstream/develop' into develop
[friendica.git] / src / Protocol / OStatus.php
index ed762084c2668d83d55cd4e113006d9b16bf4213..9a2eaeb5b712767ab9bbf0e50a829d06249858ae 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Database\DBM;
 use Friendica\Model\GlobalContact;
 use Friendica\Network\Probe;
 use Friendica\Object\Contact;
+use Friendica\Object\Photo;
 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,7 +220,7 @@ 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;
@@ -1326,7 +1323,7 @@ class OStatus
 
                switch ($siteinfo["type"]) {
                        case 'photo':
-                               $imgdata = get_photo_info($siteinfo["image"]);
+                               $imgdata = Photo::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 = Photo::getInfoFromURL($siteinfo["image"]);
                        $attributes = array("rel" => "enclosure",
                                        "href" => $siteinfo["image"],
                                        "type" => $imgdata["mime"],