123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- class WebFingerResource_Notice extends WebFingerResource
- {
- public function __construct(Notice $object)
- {
-
- parent::__construct($object);
- }
- public function updateXRD(XML_XRD $xrd)
- {
- if (Event::handle('StartWebFingerNoticeLinks', array($xrd, $this->object))) {
- if ($this->object->isLocal()) {
- $xrd->links[] = new XML_XRD_Element_Link('alternate',
- common_local_url('ApiStatusesShow',
- array('id'=>$this->object->id,
- 'format'=>'atom')),
- 'application/atom+xml');
- $xrd->links[] = new XML_XRD_Element_Link('alternate',
- common_local_url('ApiStatusesShow',
- array('id'=>$this->object->id,
- 'format'=>'json')),
- 'application/json');
- } else {
- try {
- $xrd->links[] = new XML_XRD_Element_Link('alternate',
- $this->object->getUrl(),
- 'text/html');
- } catch (InvalidUrlException $e) {
-
- }
- }
- Event::handle('EndWebFingerNoticeLinks', array($xrd, $this->object));
- }
- }
- }
|