X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOembed%2FOembedPlugin.php;h=7d66bdebefac568c7148392decc56b9693e523b7;hb=d4be5349b30f49fa049dbfc854bb2a95eeb1d5c1;hp=c51e0bfad1626e983e0a5bf8f1581b37856628bf;hpb=0d39337683c8f3fd3a996cf3e80e127ab29dd0fd;p=quix0rs-gnu-social.git diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php index c51e0bfad1..7d66bdebef 100644 --- a/plugins/Oembed/OembedPlugin.php +++ b/plugins/Oembed/OembedPlugin.php @@ -77,6 +77,9 @@ class OembedPlugin extends Plugin 'title'=>'oEmbed'),null); break; case 'shownotice': + if (!$action->notice->isLocal()) { + break; + } try { $action->element('link',array('rel'=>'alternate', 'type'=>'application/json+oembed', @@ -184,7 +187,7 @@ class OembedPlugin extends Plugin return true; } - public function onStartShowAttachmentRepresentation(HTMLOutputter $out, File $file) + public function onShowUnsupportedAttachmentRepresentation(HTMLOutputter $out, File $file) { try { $oembed = File_oembed::getByFile($file); @@ -192,6 +195,7 @@ class OembedPlugin extends Plugin return true; } + // the 'photo' type is shown through ordinary means, using StartShowAttachmentRepresentation! switch ($oembed->type) { case 'rich': case 'video': @@ -204,15 +208,11 @@ class OembedPlugin extends Plugin 'elements'=>'*+object+embed'); $out->raw(htmLawed($oembed->html,$config)); } + return false; break; - - case 'photo': - $out->element('img', array('src' => $oembed->url, 'width' => $oembed->width, 'height' => $oembed->height, 'alt' => 'alt')); - break; - - default: - Event::handle('ShowUnsupportedAttachmentRepresentation', array($out, $file)); } + + return true; } public function onCreateFileImageThumbnailSource(File $file, &$imgPath, $media=null)