if ($size === 'original') {
try {
- $avatar = Avatar::getOriginal($profile);
+ $avatar = Avatar::getUploaded($profile);
$url = $avatar->displayUrl();
} catch (Exception $e) {
$url = Avatar::defaultImage(AVATAR_PROFILE_SIZE);
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'));
}
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) {
return true;
}
- public static function getOriginal(Profile $target)
+ public static function getUploaded(Profile $target)
{
$avatar = new Avatar();
$avatar->profile_id = $target->id;
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;
}
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);
$last = $this;
do {
- $parent = $last->getOriginal();
+ $parent = $last->getParent();
if (!empty($parent) && $parent->inScope($profile)) {
$last = $parent;
continue;
// 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)) {
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;
}
/**
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);
}
$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
$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.');