]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapisearchatom.php
Do mention lookup for Webfinger accounts in OStatusPlugin
[quix0rs-gnu-social.git] / actions / twitapisearchatom.php
index 2f587d604ffe5016258336183ffdbded64f61af9..e389ddec84f43b2bf44428d7bbf99314e19eed6c 100644 (file)
@@ -31,7 +31,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/twitterapi.php';
+require_once INSTALLDIR.'/lib/api.php';
 
 /**
  * Action for outputting search results in Twitter compatible Atom
@@ -46,10 +46,10 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  *
- * @see      TwitterapiAction
+ * @see      ApiAction
  */
 
-class TwitapisearchatomAction extends TwitterapiAction
+class TwitapisearchatomAction extends ApiAction
 {
 
     var $cnt;
@@ -71,7 +71,7 @@ class TwitapisearchatomAction extends TwitterapiAction
      * @see Action::__construct
      */
 
-    function __construct($output='php://output', $indent=true)
+    function __construct($output='php://output', $indent=null)
     {
         parent::__construct($output, $indent);
     }
@@ -161,7 +161,7 @@ class TwitapisearchatomAction extends TwitterapiAction
         // lcase it for comparison
         $q = strtolower($this->query);
 
-        $search_engine = $notice->getSearchEngine('identica_notices');
+        $search_engine = $notice->getSearchEngine('notice');
         $search_engine->set_sort_mode('chron');
         $search_engine->limit(($this->page - 1) * $this->rpp,
             $this->rpp + 1, true);
@@ -208,7 +208,14 @@ class TwitapisearchatomAction extends TwitterapiAction
         $this->showFeed();
 
         foreach ($notices as $n) {
-            $this->showEntry($n);
+
+            $profile = $n->getProfile();
+
+            // Don't show notices from deleted users
+
+            if (!empty($profile)) {
+                $this->showEntry($n);
+            }
         }
 
         $this->endAtom();
@@ -238,7 +245,7 @@ class TwitapisearchatomAction extends TwitterapiAction
                              'xmlns:twitter' => 'http://api.twitter.com/',
                              'xml:lang' => 'en-US')); // XXX Other locales ?
 
-        $taguribase = common_config('integration', 'taguri');
+        $taguribase = TagURI::base();
         $this->element('id', null, "tag:$taguribase:search/$server");
 
         $site_uri = common_path(false);
@@ -322,7 +329,7 @@ class TwitapisearchatomAction extends TwitterapiAction
 
         $this->elementStart('entry');
 
-        $taguribase = common_config('integration', 'taguri');
+        $taguribase = TagURI::base();
 
         $this->element('id', null, "tag:$taguribase:$notice->id");
         $this->element('published', null, common_date_w3dtf($notice->created));
@@ -340,7 +347,7 @@ class TwitapisearchatomAction extends TwitterapiAction
         // TODO: Here is where we'd put in a link to an atom feed for threads
 
         $this->element("twitter:source", null,
-            htmlentities($this->source_link($notice->source)));
+            htmlentities($this->sourceLink($notice->source)));
 
         $this->elementStart('author');