]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/WebFinger/lib/webfingerresource/notice.php
Notice metadata for WebFinger. Not sure if implemented properly.
[quix0rs-gnu-social.git] / plugins / WebFinger / lib / webfingerresource / notice.php
1 <?php
2 /**
3  * WebFinger resource for Notice objects
4  *
5  * @package   GNUsocial
6  * @author    Mikael Nordfeldth
7  * @copyright 2013 Free Software Foundation, Inc.
8  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
9  * @link      http://status.net/
10  */
11
12 class WebFingerResource_Notice extends WebFingerResource
13 {
14     public function __construct(Notice $object)
15     {
16         // The type argument above verifies that it's our class
17         parent::__construct($object);
18     }
19
20     public function updateXRD(XML_XRD $xrd)
21     {
22         if (Event::handle('StartWebFingerNoticeLinks', array($xrd, $this->object))) {
23             $xrd->links[] = new XML_XRD_Element_Link('alternate',
24                                     common_local_url('ApiStatusesShow',
25                                         array('id'=>$this->object->id,
26                                               'format'=>'atom')),
27                                     'application/atom+xml');
28
29             $xrd->links[] = new XML_XRD_Element_Link('alternate',
30                                     common_local_url('ApiStatusesShow',
31                                         array('id'=>$this->object->id,
32                                               'format'=>'json')),
33                                     'application/json');
34             Event::handle('EndWebFingerNoticeLinks', array($xrd, $this->object));
35         }
36     }
37 }