]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/SubMirror/actions/editmirror.php
Merge branch 'threaded_replies_nightly' into 'nightly'
[quix0rs-gnu-social.git] / plugins / SubMirror / actions / editmirror.php
index 557eb0aba47d3ba123c69830b45a483c9edb9450..d3d79966b9b4e130c203c4ea0b46ce891a9d00b2 100644 (file)
@@ -26,9 +26,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); }
 
 /**
  * Takes parameters:
@@ -54,7 +52,7 @@ class EditMirrorAction extends BaseMirrorAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
@@ -63,7 +61,7 @@ class EditMirrorAction extends BaseMirrorAction
         $this->mirror = SubMirror::pkeyGet(array('subscriber' => $this->user->id,
                                                  'subscribed' => $this->profile->id));
 
-        if (!$this->mirror) {
+        if (!$this->mirror instanceof SubMirror) {
             // TRANS: Client error displayed when trying to edit an object that is not a feed mirror.
             $this->clientError(_m('Requested invalid profile to edit.'));
         }
@@ -88,7 +86,7 @@ class EditMirrorAction extends BaseMirrorAction
         }
     }
 
-    function saveMirror()
+    protected function saveMirror()
     {
         $mirror = SubMirror::getMirror($this->user, $this->profile);
         if (!$mirror) {
@@ -98,7 +96,7 @@ class EditMirrorAction extends BaseMirrorAction
 
         if ($this->delete) {
             $mirror->delete();
-            $oprofile = Ostatus_profile::staticGet('profile_id', $this->profile->id);
+            $oprofile = Ostatus_profile::getKV('profile_id', $this->profile->id);
             if ($oprofile) {
                 $oprofile->garbageCollect();
             }