]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/SubMirror/actions/addmirror.php
RSS feed items did not get a type assigned
[quix0rs-gnu-social.git] / plugins / SubMirror / actions / addmirror.php
index 0031cf1bf4735b17833c620b743bd52a873f5bae..738fa92f47366e10ba5db02b8149d5d5522df77e 100644 (file)
@@ -26,9 +26,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); }
 
 /**
  * Takes parameters:
@@ -56,7 +54,7 @@ class AddMirrorAction extends BaseMirrorAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
         $feedurl = $this->getFeedUrl();
@@ -71,23 +69,15 @@ class AddMirrorAction extends BaseMirrorAction
         switch ($provider) {
         case 'feed':
             return $this->trimmed('feedurl');
-        case 'twitter':
-            $screenie = $this->trimmed('screen_name');
-            $base = 'http://api.twitter.com/1/statuses/user_timeline.atom?screen_name=';
-            return $base . urlencode($screenie);
         default:
             // TRANS: Exception thrown when a feed provider could not be recognised.
             throw new Exception(_m('Internal form error: Unrecognized feed provider.'));
         }
     }
 
-    function saveMirror()
+    protected function saveMirror()
     {
-        if ($this->oprofile->subscribe()) {
-            SubMirror::saveMirror($this->user, $this->profile);
-        } else {
-            // TRANS: Exception thrown when a subscribing to a feed fails.
-            $this->serverError(_m('Could not subscribe to feed.'));
-        }
+        $this->oprofile->subscribe();
+        SubMirror::saveMirror($this->user, $this->profile);
     }
 }