]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Do not name anything getOriginal (because DB_DataObject calls that)
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 2 Oct 2013 13:01:11 +0000 (15:01 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 2 Oct 2013 13:01:11 +0000 (15:01 +0200)
Avatar->getOriginal has been renamed getUploaded
Notice->getOriginal has been renamed getParent

actions/avatarbynickname.php
actions/avatarsettings.php
actions/foaf.php
classes/Avatar.php
classes/Notice.php
lib/activityobject.php
plugins/TwitterBridge/lib/twitterimport.php

index dc80ec952ed85543650ff8455c8b87aad00b7659..0922bd47ec2577c4964fd604f4e3ec98decd7553 100644 (file)
@@ -73,7 +73,7 @@ class AvatarbynicknameAction extends Action
 
         if ($size === 'original') {
             try {
-                $avatar = Avatar::getOriginal($profile);
+                $avatar = Avatar::getUploaded($profile);
                 $url = $avatar->displayUrl();
             } catch (Exception $e) {
                 $url = Avatar::defaultImage(AVATAR_PROFILE_SIZE);
index 401c78a0f51a9796fb400e8d23443564516eb9c3..bc671c621be1480b37a247f8f5320009e628b0b1 100644 (file)
@@ -123,7 +123,7 @@ class AvatarsettingsAction extends SettingsAction
         if (Event::handle('StartAvatarFormData', array($this))) {
             $this->elementStart('ul', 'form_data');
             try {
-                $original = Avatar::getOriginal($profile);
+                $original = Avatar::getUploaded($profile);
 
                 $this->elementStart('li', array('id' => 'avatar_original',
                                                 'class' => 'avatar_view'));
index 94ada859d92f2875fee232f10aed4ec484332f6f..9bb1df61c68d3e81d4c5086719c27d1ef25e8097 100644 (file)
@@ -142,7 +142,7 @@ class FoafAction extends Action
         }
 
         try {
-            $avatar = Avatar::getOriginal($this->profile);
+            $avatar = Avatar::getUploaded($this->profile);
             $this->elementStart('img');
             $this->elementStart('Image', array('rdf:about' => $avatar->displayUrl()));
             foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) {
index 9c5d97ebbf98decaeec9ad88493ef7418165a8c3..d498df56d2351d9d020f39762a251e3de3f03776 100644 (file)
@@ -81,7 +81,7 @@ class Avatar extends Managed_DataObject
         return true;
     }
 
-    public static function getOriginal(Profile $target)
+    public static function getUploaded(Profile $target)
     {
         $avatar = new Avatar();
         $avatar->profile_id = $target->id;
@@ -92,9 +92,9 @@ class Avatar extends Managed_DataObject
         return $avatar;
     }
 
-    public static function hasOriginal(Profile $profile) {
+    public static function hasUploaded(Profile $profile) {
         try {
-            $avatar = Avatar::getOriginal($profile);
+            $avatar = Avatar::getUploaded($profile);
         } catch (NoResultException $e) {
             return false;
         }
@@ -192,7 +192,7 @@ class Avatar extends Managed_DataObject
             throw new Exception(_m('Avatar size too large'));
         }
 
-        $original = Avatar::getOriginal($target);
+        $original = Avatar::getUploaded($target);
 
         $imagefile = new ImageFile($target->id, Avatar::path($original->filename));
         $filename = $imagefile->resize($size);
index f6b9587c8744b7ef6b2b1e2dcd7b6e11a421a8bf..f10146300cfc2013821f6c3ca66bc5919ce46a3b 100644 (file)
@@ -924,7 +924,7 @@ class Notice extends Managed_DataObject
             $last = $this;
 
             do {
-                $parent = $last->getOriginal();
+                $parent = $last->getParent();
                 if (!empty($parent) && $parent->inScope($profile)) {
                     $last = $parent;
                     continue;
@@ -1304,7 +1304,7 @@ class Notice extends Managed_DataObject
         // If it's a reply, save for the replied-to author
 
         if (!empty($this->reply_to)) {
-            $original = $this->getOriginal();
+            $original = $this->getParent();
             if (!empty($original)) { // that'd be weird
                 $author = $original->getProfile();
                 if (!empty($author)) {
@@ -2528,18 +2528,18 @@ class Notice extends Managed_DataObject
         return $groups;
     }
 
-    protected $_original = -1;
+    protected $_parent = -1;
 
-    function getOriginal()
+    public function getParent()
     {
-        if (is_int($this->_original) && $this->_original == -1) {
+        if (is_int($this->_parent) && $this->_parent == -1) {
             if (empty($this->reply_to)) {
-                $this->_original = null;
+                $this->_parent = null;
             } else {
-                $this->_original = Notice::getKV('id', $this->reply_to);
+                $this->_parent = Notice::getKV('id', $this->reply_to);
             }
         }
-        return $this->_original;
+        return $this->_parent;
     }
 
     /**
@@ -2555,7 +2555,7 @@ class Notice extends Managed_DataObject
     function __sleep()
     {
         $vars = parent::__sleep();
-        $skip = array('_original', '_profile', '_groups', '_attachments', '_faves', '_replies', '_repeats');
+        $skip = array('_parent', '_profile', '_groups', '_attachments', '_faves', '_replies', '_repeats');
         return array_diff($vars, $skip);
     }
     
index b45a8e6e78c6f18bf55d16cf89e16c747bccff3c..a4fa62fb96a21979a314fc63ea5949ab9a97e67c 100644 (file)
@@ -460,7 +460,7 @@ class ActivityObject
             $object->link   = $profile->profileurl;
 
             try {
-                $orig = Avatar::getOriginal($profile);
+                $orig = Avatar::getUploaded($profile);
                 $object->avatarLinks[] = AvatarLink::fromAvatar($orig);
             } catch (Exception $e) {
                 // Could not find an original avatar to link
index 780fa8f92625c8ad66c40a888422e9c58944fb8e..4d6bdc0de6a78b7fef31839901b5a05362aefefc 100644 (file)
@@ -358,7 +358,7 @@ class TwitterImport
             $this->updateAvatars($twitter_user, $profile);
         }
 
-        if (Avatar::hasOriginal($profile)) {
+        if (Avatar::hasUploaded($profile)) {
             common_debug($this->name() . ' - Twitter user ' .
                          $profile->nickname .
                          ' is missing one or more local avatars.');