]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.8.x' into testing
authorEvan Prodromou <evan@controlyourself.ca>
Mon, 24 Aug 2009 20:55:49 +0000 (16:55 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Mon, 24 Aug 2009 20:55:49 +0000 (16:55 -0400)
Conflicts:
actions/twitterauthorization.php
lib/oauthclient.php
lib/twitter.php
lib/twitterapi.php
lib/twitteroauthclient.php
scripts/twitterstatusfetcher.php

1  2 
actions/twitterauthorization.php
classes/Foreign_link.php
lib/common.php
lib/mail.php
lib/twitter.php
scripts/twitterstatusfetcher.php

Simple merge
Simple merge
diff --cc lib/common.php
Simple merge
diff --cc lib/mail.php
Simple merge
diff --cc lib/twitter.php
index 2369ac2678362a91ff6fab6098eeee5625e62ec5,280cdb0a33d93d6fcfcdef2e8669f9cee55e383d..11c1374283c2d820173302748cee1a7db725d9df
@@@ -450,18 -241,18 +241,78 @@@ function remove_twitter_link($flink
  
      if (isset($user->email)) {
  
-     $result = mail_twitter_bridge_removed($user);
+         $result = mail_twitter_bridge_removed($user);
+         if (!$result) {
+             $msg = 'Unable to send email to notify ' .
+               "$user->nickname (user id: $user->id) " .
+               'that their Twitter bridge link was ' .
+               'removed!';
+             common_log(LOG_WARNING, $msg);
+         }
+     }
++}
++
++        $result = mail_twitter_bridge_removed($user);
++
++        if (!$result) {
++
++            $msg = 'Unable to send email to notify ' .
++              "$user->nickname (user id: $user->id) " .
++              'that their Twitter bridge link was ' .
++              'removed!';
++
++            common_log(LOG_WARNING, $msg);
++        }
++    }
++
++}
++
++        $result = mail_twitter_bridge_removed($user);
 +
-     if (!$result) {
++        if (!$result) {
 +
-         $msg = 'Unable to send email to notify ' .
-           "$user->nickname (user id: $user->id) " .
-           'that their Twitter bridge link was ' .
-             'removed!';
++            $msg = 'Unable to send email to notify ' .
++              "$user->nickname (user id: $user->id) " .
++              'that their Twitter bridge link was ' .
++              'removed!';
 +
-         common_log(LOG_WARNING, $msg);
++            common_log(LOG_WARNING, $msg);
++        }
 +    }
++
++}
++
++        $result = mail_twitter_bridge_removed($user);
++
++        if (!$result) {
++
++            $msg = 'Unable to send email to notify ' .
++              "$user->nickname (user id: $user->id) " .
++              'that their Twitter bridge link was ' .
++              'removed!';
++
++            common_log(LOG_WARNING, $msg);
++        }
++    }
++
++}
++
++        $result = mail_twitter_bridge_removed($user);
++
++        if (!$result) {
++
++            $msg = 'Unable to send email to notify ' .
++              "$user->nickname (user id: $user->id) " .
++              'that their Twitter bridge link was ' .
++              'removed!';
++
++            common_log(LOG_WARNING, $msg);
++        }
 +    }
 +
  }
  
index 10aef9ca3e216dd471d146c70b8ee791889b5003,f5289c5f4b7384a1daeaa7de0c8e6119cbbb820d..082bcc9622a5b929e85bc947a21d547ff08afa45
@@@ -81,126 -87,16 +87,20 @@@ class TwitterStatusFetcher extends Para
      }
  
      /**
-      * Run the daemon
+      * Find all the Twitter foreign links for users who have requested
+      * importing of their friends' timelines
       *
-      * @return void
+      * @return array flinks an array of Foreign_link objects
       */
  
-     function run()
+     function getObjects()
      {
-         if (defined('SCRIPT_DEBUG')) {
-             common_debug($this->name() .
-                 ': debugging log output enabled.');
-         }
-         do {
-             $flinks = $this->refreshFlinks();
-             foreach ($flinks as $f) {
-                 $pid = pcntl_fork();
-                 if ($pid == -1) {
-                     die ("Couldn't fork!");
-                 }
-                 if ($pid) {
-                     // Parent
-                     if (defined('SCRIPT_DEBUG')) {
-                         common_debug("Parent: forked new status ".
-                                      " fetcher process " . $pid);
-                     }
-                     $this->_children[] = $pid;
-                 } else {
-                     // Child
-                     // Each child ps needs its own DB connection
-                     // Note: DataObject::getDatabaseConnection() creates
-                     // a new connection if there isn't one already
-                     global $_DB_DATAOBJECT;
-                     $conn = &$f->getDatabaseConnection();
-                     $this->getTimeline($f);
-                     $conn->disconnect();
-                     // XXX: Couldn't find a less brutal way to blow
-                     // away a cached connection
-                     unset($_DB_DATAOBJECT['CONNECTIONS']);
-                     exit();
-                 }
-                 // Remove child from ps list as it finishes
-                 while (($c = pcntl_wait($status, WNOHANG OR WUNTRACED)) > 0) {
-                     if (defined('SCRIPT_DEBUG')) {
-                         common_debug("Child $c finished.");
-                     }
-                     $this->removePs($this->_children, $c);
-                 }
-                 // Wait! We have too many damn kids.
-                 if (sizeof($this->_children) > MAXCHILDREN) {
-                     if (defined('SCRIPT_DEBUG')) {
-                         common_debug('Too many children. Waiting...');
-                     }
-                     if (($c = pcntl_wait($status, WUNTRACED)) > 0) {
-                         if (defined('SCRIPT_DEBUG')) {
-                             common_debug("Finished waiting for $c");
-                         }
-                         $this->removePs($this->_children, $c);
-                     }
-                 }
-             }
-             // Remove all children from the process list before restarting
-             while (($c = pcntl_wait($status, WUNTRACED)) > 0) {
-                 if (defined('SCRIPT_DEBUG')) {
-                     common_debug("Child $c finished.");
-                 }
-                 $this->removePs($this->_children, $c);
-             }
-             // Rest for a bit before we fetch more statuses
-             if (defined('SCRIPT_DEBUG')) {
-                 common_debug('Waiting ' . POLL_INTERVAL .
-                     ' secs before hitting Twitter again.');
-             }
-             if (POLL_INTERVAL > 0) {
-                 sleep(POLL_INTERVAL);
-             }
-         } while (true);
-     }
-     /**
-      * Refresh the foreign links for this user
-      *
-      * @return void
-      */
+         global $_DB_DATAOBJECT;
  
-     function refreshFlinks()
-     {
++=======
 +        global $_DB_DATAOBJECT;
 +
++>>>>>>> 0.8.x:scripts/twitterstatusfetcher.php
          $flink = new Foreign_link();
          $conn = &$flink->getDatabaseConnection();