X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshownotice.php;h=5fc863486c13620fec91072fa1f7f9e3b9bd662b;hb=035081a803b005b8a2410c6936eac4027fda493c;hp=ca6b60d1f59b15de87d5f047002fffbc5ebd0591;hpb=36a8e8e8a33e384faa17360a89ecf16c785bc86f;p=quix0rs-gnu-social.git diff --git a/actions/shownotice.php b/actions/shownotice.php index ca6b60d1f5..5fc863486c 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -97,7 +97,7 @@ class ShownoticeAction extends OwnerDesignAction $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; } @@ -151,6 +151,7 @@ class ShownoticeAction extends OwnerDesignAction 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), @@ -297,10 +298,20 @@ class ShownoticeAction extends OwnerDesignAction 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. @@ -313,10 +324,14 @@ class SingleNoticeItem extends NoticeListItem 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(); }