]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
show rel=edit links in notices for authenticated users
authorEvan Prodromou <evan@status.net>
Mon, 25 Oct 2010 03:05:33 +0000 (23:05 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 25 Oct 2010 03:05:33 +0000 (23:05 -0400)
classes/Notice.php

index 60989f9bac12025688eb0b8922729d69456eefda..676e4cb546a078fec21592f17db2fd21d1886538 100644 (file)
@@ -1613,6 +1613,20 @@ class Notice extends Memcached_DataObject
             Event::handle('EndActivityGeo', array(&$this, &$xs, $lat, $lon));
         }
 
+        // @fixme check this logic
+
+        if ($this->isLocal() && !empty($cur) && $cur->id == $this->profile_id) {
+            $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));