Properly unlink all old avatars when deleting/uploading a new

We're also now using $config['image']['jpegquality'] to determine the
quality setting for resized images.

To set Avatar max size, adjust $config['avatar']['maxsize']

The getAvatar call now throws exceptions too. Related changes applied.
Now let's move Profile->avatarUrl to the Avatar class!
This commit is contained in:
Mikael Nordfeldth
2013-10-01 11:37:59 +02:00
parent a7e748479c
commit b0dfc70a54
47 changed files with 219 additions and 335 deletions

View File

@@ -174,9 +174,12 @@ class ShowgroupmessageAction extends Action
*/
function etag()
{
$avatar = $this->sender->getAvatar(AVATAR_STREAM_SIZE);
$avtime = ($avatar) ? strtotime($avatar->modified) : 0;
try {
$avatar = $this->sender->getAvatar(AVATAR_STREAM_SIZE);
$avtime = strtotime($avatar->modified);
} catch (Exception $e) {
$avtime = 0;
}
return 'W/"' . implode(':', array($this->arg('action'),
common_user_cache_hash(),

View File

@@ -78,10 +78,8 @@ class GroupMessageListItem extends Widget
$this->out->elementStart('a',
array('href' => $sender->profileurl,
'class' => 'url'));
$avatar = $sender->getAvatar(AVATAR_STREAM_SIZE);
$this->out->element('img', array('src' => ($avatar) ?
$avatar->displayUrl() :
Avatar::defaultImage(AVATAR_STREAM_SIZE),
$avatarUrl = $sender->avatarUrl(AVATAR_STREAM_SIZE);
$this->out->element('img', array('src' => $avatarUrl,
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
'class' => 'photo avatar',