Don't display avatars when posting to personal streams via ajax

darcs-hash:20081123022902-7b5ce-fbdd4e9a3df3e206caec0ca37c10a2e0a58cef85.gz
This commit is contained in:
Zach Copley 2008-11-22 21:29:02 -05:00
parent 04a4e883f0
commit fbfbe7fbc7

View File

@ -94,7 +94,7 @@ class NewnoticeAction extends Action {
common_element_end('html'); common_element_end('html');
} else { } else {
$returnto = $this->trimmed('returnto'); $returnto = $this->trimmed('returnto');
if ($returnto) { if ($returnto) {
$url = common_local_url($returnto, $url = common_local_url($returnto,
array('nickname' => $user->nickname)); array('nickname' => $user->nickname));
@ -157,21 +157,30 @@ class NewnoticeAction extends Action {
common_favor_form($notice); common_favor_form($notice);
} }
} }
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
common_element_start('a', array('href' => $profile->profileurl)); $returnto = $this->trimmed('returnto');
common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE),
'class' => 'avatar stream', # If this is the personal stream, we don't want avatars
'width' => AVATAR_STREAM_SIZE, if ($returnto != 'showstream') {
'height' => AVATAR_STREAM_SIZE,
'alt' => $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
($profile->fullname) ? $profile->fullname : common_element_start('a', array('href' => $profile->profileurl));
$profile->nickname)); common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE),
common_element_end('a'); 'class' => 'avatar stream',
common_element('a', array('href' => $profile->profileurl, 'width' => AVATAR_STREAM_SIZE,
'class' => 'nickname'), 'height' => AVATAR_STREAM_SIZE,
$profile->nickname); 'alt' =>
($profile->fullname) ? $profile->fullname :
$profile->nickname));
common_element_end('a');
common_element('a', array('href' => $profile->profileurl,
'class' => 'nickname'),
$profile->nickname);
}
# FIXME: URL, image, video, audio # FIXME: URL, image, video, audio
common_element_start('p', array('class' => 'content')); common_element_start('p', array('class' => 'content'));
if ($notice->rendered) { if ($notice->rendered) {
common_raw($notice->rendered); common_raw($notice->rendered);
} else { } else {
@ -181,6 +190,8 @@ class NewnoticeAction extends Action {
common_raw(common_render_content($notice->content, $notice)); common_raw(common_render_content($notice->content, $notice));
} }
common_element_end('p'); common_element_end('p');
$noticeurl = common_local_url('shownotice', array('notice' => $notice->id)); $noticeurl = common_local_url('shownotice', array('notice' => $notice->id));
# XXX: we need to figure this out better. Is this right? # XXX: we need to figure this out better. Is this right?
if (strcmp($notice->uri, $noticeurl) != 0 && preg_match('/^http/', $notice->uri)) { if (strcmp($notice->uri, $noticeurl) != 0 && preg_match('/^http/', $notice->uri)) {