forked from GNUsocial/gnu-social
add rel=self links to atom entries
This commit is contained in:
parent
59a7d78acb
commit
e51ed96b89
@ -1615,7 +1615,21 @@ class Notice extends Memcached_DataObject
|
|||||||
|
|
||||||
// @fixme check this logic
|
// @fixme check this logic
|
||||||
|
|
||||||
if ($this->isLocal() && !empty($cur) && $cur->id == $this->profile_id) {
|
if ($this->isLocal()) {
|
||||||
|
|
||||||
|
$selfUrl = common_local_url('ApiStatusesShow', array('id' => $this->id,
|
||||||
|
'format' => 'atom'));
|
||||||
|
|
||||||
|
if (Event::handle('StartActivityRelSelf', array(&$this, &$xs, &$selfUrl))) {
|
||||||
|
$xs->element('link', array('rel' => 'self',
|
||||||
|
'type' => 'application/atom+xml',
|
||||||
|
'href' => $selfUrl));
|
||||||
|
Event::handle('EndActivityRelSelf', array(&$this, &$xs, $selfUrl));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($cur) && $cur->id == $this->profile_id) {
|
||||||
|
|
||||||
|
// note: $selfUrl may have been changed by a plugin
|
||||||
$relEditUrl = common_local_url('ApiStatusesShow', array('id' => $this->id,
|
$relEditUrl = common_local_url('ApiStatusesShow', array('id' => $this->id,
|
||||||
'format' => 'atom'));
|
'format' => 'atom'));
|
||||||
|
|
||||||
@ -1626,6 +1640,7 @@ class Notice extends Memcached_DataObject
|
|||||||
Event::handle('EndActivityRelEdit', array(&$this, &$xs, $relEditUrl));
|
Event::handle('EndActivityRelEdit', array(&$this, &$xs, $relEditUrl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Event::handle('StartActivityEnd', array(&$this, &$xs))) {
|
if (Event::handle('StartActivityEnd', array(&$this, &$xs))) {
|
||||||
$xs->elementEnd('entry');
|
$xs->elementEnd('entry');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user