GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit 39f43e41 authored by mmn's avatar mmn

Do not name anything getOriginal (because DB_DataObject calls that)

Avatar->getOriginal has been renamed getUploaded
Notice->getOriginal has been renamed getParent
parent 7979918b
......@@ -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);
......
......@@ -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'));
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment