]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
move inbox insert code to status saver main loop
authorEvan Prodromou <evan@status.net>
Sat, 4 Sep 2010 15:40:33 +0000 (11:40 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 7 Sep 2010 08:00:57 +0000 (04:00 -0400)
plugins/TwitterBridge/daemons/twitterstatusfetcher.php

index 9892ffc057e660d7a8c29fe9483769cc57ed98be..e3f9553ffeea01b883e0c43292757622b9d16fd6 100755 (executable)
@@ -222,7 +222,11 @@ class TwitterStatusFetcher extends ParallelizingDaemon
                 continue;
             }
 
-            $this->saveStatus($status, $flink);
+            $notice = $this->saveStatus($status);
+
+            if (!empty($notice)) {
+                Inbox::insertNotice($flink->user_id, $notice->id);
+            }
         }
 
         // Okay, record the time we synced with Twitter for posterity
@@ -231,7 +235,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
         $flink->update();
     }
 
-    function saveStatus($status, $flink=null)
+    function saveStatus($status)
     {
         $profile = $this->ensureProfile($status->user);
 
@@ -320,9 +324,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
             Event::handle('EndNoticeSave', array($notice));
         }
 
-        if (!empty($flink)) {
-            Inbox::insertNotice($flink->user_id, $notice->id);
-        }
         $notice->blowOnInsert();
 
         return $notice;