X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshownotice.php;h=3bc52b2dbc7bae3fef45a4bf7cedc24df156bc38;hb=60335fcbdf7b2ae4d27e7d413e7f5f46f61feda5;hp=1ec38a76bcf8cf7208dc94055f202f626a66bd18;hpb=d846c5fc9927b93e59192e19fd59a8d350b0e3c9;p=quix0rs-gnu-social.git diff --git a/actions/shownotice.php b/actions/shownotice.php index 1ec38a76bc..3bc52b2dbc 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -1,6 +1,6 @@ . * * @category Personal - * @package Laconica - * @author Evan Prodromou - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,10 +39,10 @@ require_once INSTALLDIR.'/lib/feedlist.php'; * Show a single notice * * @category Personal - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ShownoticeAction extends OwnerDesignAction @@ -97,8 +97,8 @@ class ShownoticeAction extends OwnerDesignAction $this->user = User::staticGet('id', $this->profile->id); - if (empty($this->user)) { - $this->serverError(_('Not a local notice'), 500); + if (! $this->notice->is_local) { + common_redirect($this->notice->uri); return false; } @@ -190,7 +190,7 @@ class ShownoticeAction extends OwnerDesignAction { parent::handle($args); - if ($this->notice->is_local == 0) { + if ($this->notice->is_local == Notice::REMOTE_OMB) { if (!empty($this->notice->url)) { common_redirect($this->notice->url, 301); } else if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) { @@ -275,6 +275,20 @@ class ShownoticeAction extends OwnerDesignAction $this->element('meta', array('name' => 'microid', 'content' => $id->toString())); } + $this->element('link',array('rel'=>'alternate', + 'type'=>'application/json+oembed', + 'href'=>common_local_url( + 'oembed', + array(), + array('format'=>'json','url'=>$this->notice->uri)), + 'title'=>'oEmbed'),null); + $this->element('link',array('rel'=>'alternate', + 'type'=>'text/xml+oembed', + 'href'=>common_local_url( + 'oembed', + array(), + array('format'=>'xml','url'=>$this->notice->uri)), + 'title'=>'oEmbed'),null); } }