]> git.mxchange.org Git - friendica-addons.git/commitdiff
Photo to namespace
authorAdam Magness <adam.magness@gmail.com>
Wed, 29 Nov 2017 17:38:39 +0000 (12:38 -0500)
committerAdam Magness <adam.magness@gmail.com>
Wed, 29 Nov 2017 17:38:39 +0000 (12:38 -0500)
updates for Photo class moving to Friendica\Object namespace.

fromgplus/fromgplus.php
pumpio/pumpio.php
statusnet/statusnet.php
twitter/twitter.php

index 0627b026af45fa2a34a2bafdded985f7975d3d22..e0a49b3fda32d4ed3856345d1da49ad4abcf40b2 100644 (file)
@@ -11,10 +11,11 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
 
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
+use Friendica\Object\Photo;
 
-require_once('mod/share.php');
-require_once('mod/parse_url.php');
-require_once('include/text.php');
+require_once 'mod/share.php';
+require_once 'mod/parse_url.php';
+require_once 'include/text.php';
 
 function fromgplus_install() {
        register_hook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
@@ -263,12 +264,12 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) {
        }
 
        if ($cleaned["full"] != "")
-               $infoFull = get_photo_info($cleaned["full"]);
+               $infoFull = Photo::getPhotoInfo($cleaned["full"]);
        else
                $infoFull = array("0" => 0, "1" => 0);
 
        if ($cleaned["preview"] != "")
-               $infoPreview = get_photo_info($cleaned["preview"]);
+               $infoPreview = Photo::getPhotoInfo($cleaned["preview"]);
        else
                $infoFull = array("0" => 0, "1" => 0);
 
index 358a2257163e92a5fd0a07ce54644117016d9a62..37a09c7a6e8ea882336ce5a18aae1e67b635d493 100644 (file)
@@ -5,12 +5,12 @@
  * Version: 0.2
  * Author: Michael Vogel <http://pirati.ca/profile/heluecht>
  */
-
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
 use Friendica\Model\GlobalContact;
 use Friendica\Object\Contact;
+use Friendica\Object\Photo;
 
 require 'addon/pumpio/oauth/http.php';
 require 'addon/pumpio/oauth/oauth_client.php';
@@ -1046,8 +1046,7 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
                */
        }
 
-       if (function_exists("update_contact_avatar"))
-               update_contact_avatar($contact->image->url, $uid, $contact_id);
+       Photo::updateContactAvatar($contact->image->url, $uid, $contact_id);
 
        return($contact_id);
 }
index 94393313e6a440228a97506649a14389e1da03b4..3c6ac4995cad988726636829fed15d99f0583495 100644 (file)
@@ -49,6 +49,7 @@ require_once 'include/enotify.php';
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Model\GlobalContact;
+use Friendica\Object\Photo;
 
 class StatusNetOAuth extends TwitterOAuth {
     function get_maxlength() {
@@ -999,7 +1000,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user) {
 
                require_once("Photo.php");
 
-               $photos = import_profile_photo($contact->profile_image_url,$uid,$contact_id);
+               $photos = Photo::importProfilePhoto($contact->profile_image_url,$uid,$contact_id);
 
                q("UPDATE `contact` SET `photo` = '%s',
                                        `thumb` = '%s',
@@ -1026,7 +1027,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user) {
 
                        require_once("Photo.php");
 
-                       $photos = import_profile_photo($contact->profile_image_url, $uid, $r[0]['id']);
+                       $photos = Photo::importProfilePhoto($contact->profile_image_url, $uid, $r[0]['id']);
 
                        q("UPDATE `contact` SET `photo` = '%s',
                                                `thumb` = '%s',
index f0c71cf41b78eaca2efa7562818fe67d4a0569c5..8b42e1872bd4539e24a7a9d78698849d39a5d137 100644 (file)
@@ -64,6 +64,7 @@ use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
 use Friendica\Model\GlobalContact;
+use Friendica\Object\Photo;
 
 require_once 'include/enotify.php';
 
@@ -950,7 +951,7 @@ function twitter_fix_avatar($avatar) {
 
        $new_avatar = str_replace("_normal.", ".", $avatar);
 
-       $info = get_photo_info($new_avatar);
+       $info = Photo::getPhotoInfo($new_avatar);
        if (!$info)
                $new_avatar = $avatar;
 
@@ -1027,7 +1028,7 @@ function twitter_fetch_contact($uid, $contact, $create_user) {
 
                require_once("Photo.php");
 
-               $photos = import_profile_photo($avatar, $uid, $contact_id, true);
+               $photos = Photo::importProfilePhoto($avatar, $uid, $contact_id, true);
 
                if ($photos) {
                        q("UPDATE `contact` SET `photo` = '%s',
@@ -1060,7 +1061,7 @@ function twitter_fetch_contact($uid, $contact, $create_user) {
 
                        require_once("Photo.php");
 
-                       $photos = import_profile_photo($avatar, $uid, $r[0]['id'], true);
+                       $photos = Photo::importProfilePhoto($avatar, $uid, $r[0]['id'], true);
 
                        if ($photos) {
                                q("UPDATE `contact` SET `photo` = '%s',