summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-02 11:54:02 -0800
committerBrion Vibber <brion@pobox.com>2010-03-02 11:54:02 -0800
commit6b134ae4c7e15ce9853bc82545c3beb67a2dfdad (patch)
treec28f2857d42b6bc97f602fe4c3458a5dd2ca9bc2 /classes/Notice.php
parentf596e072e79ec87541b27008ea2327275e5fc669 (diff)
Dropped deprecated timestamp-based 'since' parameter for all API methods. When it sneaks in it can cause some very slow queries due to mismatches with the indexing.
Twitter removed 'since' support some time ago, and we've already removed it from the public timeline, so it shouldn't be missed.
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php26
1 files changed, 9 insertions, 17 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 3702dbcfa..22dcbcd74 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -559,17 +559,17 @@ class Notice extends Memcached_DataObject
}
}
- function publicStream($offset=0, $limit=20, $since_id=0, $max_id=0, $since=null)
+ function publicStream($offset=0, $limit=20, $since_id=0, $max_id=0)
{
$ids = Notice::stream(array('Notice', '_publicStreamDirect'),
array(),
'public',
- $offset, $limit, $since_id, $max_id, $since);
+ $offset, $limit, $since_id, $max_id);
return Notice::getStreamByIds($ids);
}
- function _publicStreamDirect($offset=0, $limit=20, $since_id=0, $max_id=0, $since=null)
+ function _publicStreamDirect($offset=0, $limit=20, $since_id=0, $max_id=0)
{
$notice = new Notice();
@@ -598,10 +598,6 @@ class Notice extends Memcached_DataObject
$notice->whereAdd('id <= ' . $max_id);
}
- if (!is_null($since)) {
- $notice->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\'');
- }
-
$ids = array();
if ($notice->find()) {
@@ -616,17 +612,17 @@ class Notice extends Memcached_DataObject
return $ids;
}
- function conversationStream($id, $offset=0, $limit=20, $since_id=0, $max_id=0, $since=null)
+ function conversationStream($id, $offset=0, $limit=20, $since_id=0, $max_id=0)
{
$ids = Notice::stream(array('Notice', '_conversationStreamDirect'),
array($id),
'notice:conversation_ids:'.$id,
- $offset, $limit, $since_id, $max_id, $since);
+ $offset, $limit, $since_id, $max_id);
return Notice::getStreamByIds($ids);
}
- function _conversationStreamDirect($id, $offset=0, $limit=20, $since_id=0, $max_id=0, $since=null)
+ function _conversationStreamDirect($id, $offset=0, $limit=20, $since_id=0, $max_id=0)
{
$notice = new Notice();
@@ -649,10 +645,6 @@ class Notice extends Memcached_DataObject
$notice->whereAdd('id <= ' . $max_id);
}
- if (!is_null($since)) {
- $notice->whereAdd('created > \'' . date('Y-m-d H:i:s', $since) . '\'');
- }
-
$ids = array();
if ($notice->find()) {
@@ -1270,16 +1262,16 @@ class Notice extends Memcached_DataObject
}
}
- function stream($fn, $args, $cachekey, $offset=0, $limit=20, $since_id=0, $max_id=0, $since=null)
+ function stream($fn, $args, $cachekey, $offset=0, $limit=20, $since_id=0, $max_id=0)
{
$cache = common_memcache();
if (empty($cache) ||
- $since_id != 0 || $max_id != 0 || (!is_null($since) && $since > 0) ||
+ $since_id != 0 || $max_id != 0 ||
is_null($limit) ||
($offset + $limit) > NOTICE_CACHE_WINDOW) {
return call_user_func_array($fn, array_merge($args, array($offset, $limit, $since_id,
- $max_id, $since)));
+ $max_id)));
}
$idkey = common_cache_key($cachekey);