? feedapi-update_sql.patch
? feedapi.20080501.patch
? feedapi.module-long_url.patch
? feedapi_1_x_dev_run_cron_feed_owners.patch
? feedapi_opml-override.patch
? feedapi_skip_bit.patch
? run_cron_feed_owners.patch
? simplified.patch
? parser_simplepie/simplepie.inc
Index: feedapi.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feedapi/feedapi.module,v
retrieving revision 1.23.2.132
diff -u -p -r1.23.2.132 feedapi.module
--- feedapi.module	9 May 2008 13:30:07 -0000	1.23.2.132
+++ feedapi.module	12 May 2008 09:27:06 -0000
@@ -618,6 +618,7 @@ function feedapi_feedapi_settings_form($
  * Implementation of hook_cron().
  */
 function feedapi_cron() {
+  global $user;
   db_query('DELETE FROM {feedapi_stat} WHERE timestamp < %d', variable_get('cron_semaphore', FALSE) - FEEDAPI_CRON_STAT_LIFETIME);
   
   // Initialize counters
@@ -632,12 +633,14 @@ function feedapi_cron() {
   // time limit even when we have many thousands of them. 
   $start = time() - FEEDAPI_CRON_MIN_REFRESH_TIME;
   $process = 0;
+  $old_user = $user;
   // The counter process will be > 0 if we've selected less feeds
   while (!$process && feedapi_cron_time()) {
     $process = FEEDAPI_CRON_FEEDS;
-    $result = db_query_range("SELECT nid FROM {feedapi} WHERE checked <= %d AND skip = 0 ORDER BY checked", $start, 0, FEEDAPI_CRON_FEEDS);
+    $result = db_query_range("SELECT f.nid, n.uid FROM {feedapi} f NATURAL JOIN {node} n WHERE checked <= %d AND skip = 0 ORDER BY checked", $start, 0, FEEDAPI_CRON_FEEDS);
 
     while (feedapi_cron_time() && $feed = db_fetch_object($result)) {
+      $user = user_load(array('uid' => $feed->uid));
       // Call the refresh process for each feed and store counters
       $counter = feedapi_invoke_feedapi('refresh', $feed, TRUE);
       if ($counter) {
@@ -649,6 +652,7 @@ function feedapi_cron() {
       $process--;
     }
   }
+  $user = $old_user;
 }
 
 /**
