]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
remove Notice::gc() for now
[quix0rs-gnu-social.git] / classes / Notice.php
index 442eb00fdb2333de84025cee7f1c5e2241e30108..7d050262674265f13dfe0cbeb577aa1a41e62c9a 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -17,7 +17,7 @@
  * along with this program.     If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
 /**
  * Table Definition for notice
@@ -58,7 +58,7 @@ class Notice extends Memcached_DataObject
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
-    /* Notice types */ 
+    /* Notice types */
     const LOCAL_PUBLIC    =  1;
     const REMOTE_OMB      =  0;
     const LOCAL_NONPUBLIC = -1;
@@ -248,17 +248,6 @@ class Notice extends Memcached_DataObject
 
             $notice->saveUrls();
 
-            // FIXME: why do we have to re-render the content?
-            // Remove this if it's not necessary.
-
-            $orig2 = clone($notice);
-
-            $notice->rendered = common_render_content($final, $notice);
-            if (!$notice->update($orig2)) {
-                common_log_db_error($notice, 'UPDATE', __FILE__);
-                return _('Problem saving notice.');
-            }
-
             $notice->query('COMMIT');
 
             Event::handle('EndNoticeSave', array($notice));
@@ -743,6 +732,10 @@ class Notice extends Memcached_DataObject
             return new ArrayWrapper($notices);
         } else {
             $notice = new Notice();
+            if (empty($ids)) {
+                //if no IDs requested, just return the notice object
+                return $notice;
+            }
             $notice->whereAdd('id in (' . implode(', ', $ids) . ')');
             $notice->orderBy('id DESC');
 
@@ -904,7 +897,8 @@ class Notice extends Memcached_DataObject
                 $qry .= '('.$id.', '.$this->id.', '.$source.", '".$this->created. "') ";
                 $cnt++;
                 if (rand() % NOTICE_INBOX_SOFT_LIMIT == 0) {
-                    Notice_inbox::gc($id);
+                    // FIXME: Causes lag in replicated servers
+                    // Notice_inbox::gc($id);
                 }
                 if ($cnt >= MAX_BOXCARS) {
                     $inbox = new Notice_inbox();