]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Merge remote branch 'gitorious/0.9.x' into 0.9.x
[quix0rs-gnu-social.git] / classes / Notice.php
index eff0d32515c557335338b1712022ace55548d010..85c7dabea48f5d9f31667042cab2c5b07ed8fccd 100644 (file)
@@ -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));