X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshownotice.php;h=5b3ec93de10b64082bceb30bc5de46a4c3693c2d;hb=255ba42ef120a3ee0ac21c0c639730d8317b7e79;hp=9c5d83441b8688e6ed08b52cf22c9dfdf71f6ba5;hpb=696e4ba393c658d5b2e1fe46e1389bd7b2cfdb34;p=quix0rs-gnu-social.git diff --git a/actions/shownotice.php b/actions/shownotice.php index 9c5d83441b..5b3ec93de1 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -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), @@ -277,12 +278,6 @@ class ShownoticeAction extends OwnerDesignAction 'content' => $id->toString())); } - if ($user->jabbermicroid && $user->jabber && $this->notice->uri) { - $id = new Microid('xmpp:', $user->jabber, - $this->notice->uri); - $this->element('meta', array('name' => 'microid', - 'content' => $id->toString())); - } $this->element('link',array('rel'=>'alternate', 'type'=>'application/json+oembed', 'href'=>common_local_url( @@ -297,10 +292,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 +318,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(); }