]> git.mxchange.org Git - friendica-addons.git/commitdiff
Move Objects to Model
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 8 Dec 2017 01:16:42 +0000 (20:16 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Fri, 8 Dec 2017 01:16:42 +0000 (20:16 -0500)
- Object\Photo -> Object\Image and Model\Photo
- Object\Contact -> Model\Contact
- Model\GlobalContact -> Model\GContact

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

index 1a1ae682cfee3d8d4937a6df98b0d4ebe6c8d36a..0699f75bbf178d3d6a64191c5b830d26e29128c2 100644 (file)
@@ -11,7 +11,7 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
 
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
-use Friendica\Object\Photo;
+use Friendica\Object\Image;
 
 require_once 'mod/share.php';
 require_once 'mod/parse_url.php';
@@ -264,12 +264,12 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) {
        }
 
        if ($cleaned["full"] != "")
-               $infoFull = Photo::getInfoFromURL($cleaned["full"]);
+               $infoFull = Image::getInfoFromURL($cleaned["full"]);
        else
                $infoFull = array("0" => 0, "1" => 0);
 
        if ($cleaned["preview"] != "")
-               $infoPreview = Photo::getInfoFromURL($cleaned["preview"]);
+               $infoPreview = Image::getInfoFromURL($cleaned["preview"]);
        else
                $infoFull = array("0" => 0, "1" => 0);
 
@@ -352,9 +352,9 @@ function fromgplus_handleattachments($a, $uid, $item, $displaytext, $shared) {
                                        $images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
                                } else {
                                        if ($attachment->fullImage->url != "") {
-                                               $images = Photo::storePhoto($a, $uid, "", $attachment->fullImage->url);
+                                               $images = Image::storePhoto($a, $uid, "", $attachment->fullImage->url);
                                        } elseif ($attachment->image->url != "") {
-                                               $images = Photo::storePhoto($a, $uid, "", $attachment->image->url);
+                                               $images = Image::storePhoto($a, $uid, "", $attachment->image->url);
                                        }
                                }
 
index 96883826521d1e31b120be2c9dfa0903297a520e..c3201f424e9ae0dee5c48f38874cf94845abbd58 100644 (file)
@@ -8,8 +8,8 @@
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
-use Friendica\Model\GlobalContact;
-use Friendica\Object\Contact;
+use Friendica\Model\Contact;
+use Friendica\Model\GContact;
 
 require 'addon/pumpio/oauth/http.php';
 require 'addon/pumpio/oauth/oauth_client.php';
@@ -974,7 +974,7 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = tru
 
 function pumpio_get_contact($uid, $contact, $no_insert = false) {
 
-       GlobalContact::update(array("url" => $contact->url, "network" => NETWORK_PUMPIO, "generation" => 2,
+       GContact::update(array("url" => $contact->url, "network" => NETWORK_PUMPIO, "generation" => 2,
                        "photo" => $contact->image->url, "name" => $contact->displayName,  "hide" => true,
                        "nick" => $contact->preferredUsername, "location" => $contact->location->displayName,
                        "about" => $contact->summary, "addr" => str_replace("acct:", "", $contact->id)));
index e8e89031646dcbdb6a5cae57cba0fbc8a8d0ee1c..d55c9febca8c8119ba98a63ea606bb54753a15c4 100644 (file)
@@ -63,8 +63,9 @@
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
-use Friendica\Model\GlobalContact;
-use Friendica\Object\Photo;
+use Friendica\Model\GContact;
+use Friendica\Model\Photo;
+use Friendica\Object\Image;
 
 require_once 'include/enotify.php';
 
@@ -949,7 +950,7 @@ function twitter_queue_hook(&$a,&$b) {
 function twitter_fix_avatar($avatar) {
        $new_avatar = str_replace("_normal.", ".", $avatar);
 
-       $info = Photo::getInfoFromURL($new_avatar);
+       $info = Image::getInfoFromURL($new_avatar);
        if (!$info)
                $new_avatar = $avatar;
 
@@ -963,7 +964,7 @@ function twitter_fetch_contact($uid, $contact, $create_user) {
 
        $avatar = twitter_fix_avatar($contact->profile_image_url_https);
 
-       GlobalContact::update(array("url" => "https://twitter.com/".$contact->screen_name,
+       GContact::update(array("url" => "https://twitter.com/".$contact->screen_name,
                        "network" => NETWORK_TWITTER, "photo" => $avatar,  "hide" => true,
                        "name" => $contact->name, "nick" => $contact->screen_name,
                        "location" => $contact->location, "about" => $contact->description,