summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-11-15 11:57:19 -0500
committerEvan Prodromou <evan@status.net>2010-11-15 11:57:19 -0500
commitc1cee3b27ffa1529009195604c5495bef4f83bc2 (patch)
tree42ae51f86b085978c9f1a28820ec4a69af1589b9 /classes
parentfdf3a23da7769586a818ca2219ec6bc1b46587de (diff)
parentcb371d65c18771f8fcdcbeb450c063b844c000df (diff)
Merge branch 'atompub' into 0.9.x
Conflicts: actions/apistatusesshow.php actions/apitimelineuser.php
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index eff0d3251..85c7dabea 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1611,6 +1611,35 @@ class Notice extends Memcached_DataObject
Event::handle('EndActivityGeo', array(&$this, &$xs, $lat, $lon));
}
+ // @fixme check this logic
+
+ 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,
+ 'format' => 'atom'));
+
+ if (Event::handle('StartActivityRelEdit', array(&$this, &$xs, &$relEditUrl))) {
+ $xs->element('link', array('rel' => 'edit',
+ 'type' => 'application/atom+xml',
+ 'href' => $relEditUrl));
+ Event::handle('EndActivityRelEdit', array(&$this, &$xs, $relEditUrl));
+ }
+ }
+ }
+
if (Event::handle('StartActivityEnd', array(&$this, &$xs))) {
$xs->elementEnd('entry');
Event::handle('EndActivityEnd', array(&$this, &$xs));