Merge branch 'master' into 0.8.x

Conflicts:
	scripts/twitterstatusfetcher.php
This commit is contained in:
Evan Prodromou 2009-07-23 14:45:21 -07:00
commit 749d9bfbbf
4 changed files with 5 additions and 4 deletions

View File

@ -59,7 +59,7 @@ class Fave extends Memcached_DataObject
$qry = 'SELECT fave.* FROM fave '; $qry = 'SELECT fave.* FROM fave ';
$qry .= 'INNER JOIN notice ON fave.notice_id = notice.id '; $qry .= 'INNER JOIN notice ON fave.notice_id = notice.id ';
$qry .= 'WHERE fave.user_id = ' . $user_id . ' '; $qry .= 'WHERE fave.user_id = ' . $user_id . ' ';
$qry .= 'AND notice.is_local != ' . NOTICE_GATEWAY . ' '; $qry .= 'AND notice.is_local != ' . Notice::GATEWAY . ' ';
} }
if ($since_id != 0) { if ($since_id != 0) {

View File

@ -32,7 +32,6 @@ define('NOTICE_CACHE_WINDOW', 61);
define('NOTICE_LOCAL_PUBLIC', 1); define('NOTICE_LOCAL_PUBLIC', 1);
define('NOTICE_REMOTE_OMB', 0); define('NOTICE_REMOTE_OMB', 0);
define('NOTICE_LOCAL_NONPUBLIC', -1); define('NOTICE_LOCAL_NONPUBLIC', -1);
define('NOTICE_GATEWAY', -2);
define('MAX_BOXCARS', 128); define('MAX_BOXCARS', 128);
@ -63,6 +62,8 @@ class Notice extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */ /* the code above is auto generated do not remove the tag below */
###END_AUTOCODE ###END_AUTOCODE
const GATEWAY = -2;
function getProfile() function getProfile()
{ {
return Profile::staticGet('id', $this->profile_id); return Profile::staticGet('id', $this->profile_id);

View File

@ -443,7 +443,7 @@ class User extends Memcached_DataObject
'SELECT notice.* ' . 'SELECT notice.* ' .
'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' . 'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' .
'WHERE subscription.subscriber = %d ' . 'WHERE subscription.subscriber = %d ' .
'AND notice.is_local != ' . NOTICE_GATEWAY; 'AND notice.is_local != ' . Notice::GATEWAY;
return Notice::getStream(sprintf($qry, $this->id), return Notice::getStream(sprintf($qry, $this->id),
'user:notices_with_friends:' . $this->id, 'user:notices_with_friends:' . $this->id,
$offset, $limit, $since_id, $before_id, $offset, $limit, $since_id, $before_id,

View File

@ -330,7 +330,7 @@ class TwitterStatusFetcher extends Daemon
$notice->rendered = common_render_content($notice->content, $notice); $notice->rendered = common_render_content($notice->content, $notice);
$notice->source = 'twitter'; $notice->source = 'twitter';
$notice->reply_to = null; // XXX lookup reply $notice->reply_to = null; // XXX lookup reply
$notice->is_local = NOTICE_GATEWAY; $notice->is_local = Notice::GATEWAY;
if (Event::handle('StartNoticeSave', array(&$notice))) { if (Event::handle('StartNoticeSave', array(&$notice))) {
$id = $notice->insert(); $id = $notice->insert();