]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added oEmbed discovery for attachments and notices
authorCraig Andrews <candrews@integralblue.com>
Wed, 15 Jul 2009 19:11:29 +0000 (15:11 -0400)
committerCraig Andrews <candrews@integralblue.com>
Wed, 15 Jul 2009 19:11:29 +0000 (15:11 -0400)
actions/attachment.php
actions/shownotice.php

index ee4cd9640d971d1b0b19bbe1cdbfa6b1ee5be67b..c9c416cb5bf3c400b4eb298b7beda5e370d836ab 100644 (file)
@@ -98,6 +98,28 @@ class AttachmentAction extends Action
         return $a->title();
     }
 
+    function extraHead()
+    {
+        $this->element('link',array('rel'=>'alternate',
+            'type'=>'application/json+oembed',
+            'href'=>common_local_url(
+                'api',
+                array('apiaction'=>'laconica','method'=>'oembed.json'),
+                array('url'=>
+                    common_local_url('attachment',
+                        array('attachment' => $this->attachment->id)))),
+            'title'=>'oEmbed'),null);
+        $this->element('link',array('rel'=>'alternate',
+            'type'=>'text/xml+oembed',
+            'href'=>common_local_url(
+                'api',
+                array('apiaction'=>'laconica','method'=>'oembed.xml'),
+                array('url'=>
+                    common_local_url('attachment',
+                        array('attachment' => $this->attachment->id)))),
+            'title'=>'oEmbed'),null);
+    }
+
     /**
      * Handle input
      *
index 1ec38a76bcf8cf7208dc94055f202f626a66bd18..4cf226f1cf301c5136dcaa4722787c7154ab0282 100644 (file)
@@ -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(
+                'api',
+                array('apiaction'=>'laconica','method'=>'oembed.json'),
+                array('url'=>$this->notice->uri)),
+            'title'=>'oEmbed'),null);
+        $this->element('link',array('rel'=>'alternate',
+            'type'=>'text/xml+oembed',
+            'href'=>common_local_url(
+                'api',
+                array('apiaction'=>'laconica','method'=>'oembed.xml'),
+                array('url'=>$this->notice->uri)),
+            'title'=>'oEmbed'),null);
     }
 }