]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/distribqueuehandler.php
Remove deprecated call-time pass-by-reference
[quix0rs-gnu-social.git] / lib / distribqueuehandler.php
index f458d238da97c77cdd6006ee821de09ab361c36b..d2be7a92c72488d846374bb27413f103490fd34d 100644 (file)
@@ -62,23 +62,36 @@ class DistribQueueHandler
     {
         // XXX: do we need to change this for remote users?
 
-        $notice->saveTags();
+        try {
+            $notice->addToInboxes();
+        } catch (Exception $e) {
+            $this->logit($notice, $e);
+        }
 
-        $groups = $notice->saveGroups();
+        try {
+            Event::handle('EndNoticeSave', array($notice));
+            // Enqueue for other handlers
+        } catch (Exception $e) {
+            $this->logit($notice, $e);
+        }
 
-        $recipients = $notice->saveReplies();
+        try {
+            common_enqueue_notice($notice);
+        } catch (Exception $e) {
+            $this->logit($notice, $e);
+        }
 
-        $notice->addToInboxes($groups, $recipients);
-
-        $notice->saveUrls();
-
-        Event::handle('EndNoticeSave', array($notice));
-
-        // Enqueue for other handlers
+        return true;
+    }
 
-        common_enqueue_notice($notice);
+    protected function logit($notice, $e)
+    {
+        common_log(LOG_ERR, "Distrib queue exception saving notice $notice->id: " .
+            $e->getMessage() . ' ' .
+            str_replace("\n", " ", $e->getTraceAsString()));
 
-        return true;
+        // We'll still return true so we don't get stuck in a loop
+        // trying to run a bad insert over and over...
     }
 }