$this->profile = $this->notice->getProfile();
if (empty($this->profile)) {
- $this->serverError(_('Notice has no profile'), 500);
+ $this->serverError(_('Notice has no profile.'), 500);
return false;
}
strtotime($this->avatar->modified) : 0;
return 'W/"' . implode(':', array($this->arg('action'),
+ common_user_cache_hash(),
common_language(),
$this->notice->id,
strtotime($this->notice->created),
array(),
array('format'=>'xml','url'=>$this->notice->uri)),
'title'=>'oEmbed'),null);
+
+ // Extras to aid in sharing notices to Facebook
+ $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
+ $avatarUrl = ($avatar) ?
+ $avatar->displayUrl() :
+ Avatar::defaultImage(AVATAR_PROFILE_SIZE);
+ $this->element('meta', array('property' => 'og:image',
+ 'content' => $avatarUrl));
+ $this->element('meta', array('property' => 'og:description',
+ 'content' => $this->notice->content));
}
}
-class SingleNoticeItem extends NoticeListItem
+class SingleNoticeItem extends DoFollowListItem
{
/**
* recipe function for displaying a single notice.
function show()
{
$this->showStart();
- $this->showNotice();
- $this->showNoticeAttachments();
- $this->showNoticeInfo();
- $this->showNoticeOptions();
+ if (Event::handle('StartShowNoticeItem', array($this))) {
+ $this->showNotice();
+ $this->showNoticeAttachments();
+ $this->showNoticeInfo();
+ $this->showNoticeOptions();
+ Event::handle('EndShowNoticeItem', array($this));
+ }
+
$this->showEnd();
}