summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@status.net>2010-11-19 14:03:59 -0800
committerBrion Vibber <brion@status.net>2010-11-19 14:03:59 -0800
commite0e7cb7c5376a7adfdcf8e0724aedfae3de471ef (patch)
treeb6f7b353545b3bcff3a0325d4fb33d863a364afd
parent407663fb402f0384cced2b63a2f901d19ab71d19 (diff)
parentca55d6c514d4ecadbb7d3fdc4c618dfd9da4a786 (diff)
Merge branch 'master' into 0.9.x
-rw-r--r--actions/apisearchatom.php6
-rw-r--r--actions/apisearchjson.php7
-rw-r--r--lib/jsonsearchresultslist.php4
3 files changed, 14 insertions, 3 deletions
diff --git a/actions/apisearchatom.php b/actions/apisearchatom.php
index 6743e92c8..32ff918da 100644
--- a/actions/apisearchatom.php
+++ b/actions/apisearchatom.php
@@ -114,7 +114,7 @@ class ApiSearchAtomAction extends ApiPrivateAuthAction
$this->page = 1;
}
- // TODO: Suppport since_id -- we need to tweak the backend
+ // TODO: Suppport max_id -- we need to tweak the backend
// Search classes to support it.
$this->since_id = $this->trimmed('since_id');
@@ -177,6 +177,10 @@ class ApiSearchAtomAction extends ApiPrivateAuthAction
$this->max_id = $notice->id;
}
+ if ($this->since_id && $notice->id <= $this->since_id) {
+ break;
+ }
+
if ($cnt > $this->rpp) {
break;
}
diff --git a/actions/apisearchjson.php b/actions/apisearchjson.php
index 38e612ee3..dd442b7f2 100644
--- a/actions/apisearchjson.php
+++ b/actions/apisearchjson.php
@@ -85,6 +85,9 @@ class ApiSearchJSONAction extends ApiPrivateAuthAction
$this->page = 1;
}
+ // TODO: Suppport max_id -- we need to tweak the backend
+ // Search classes to support it.
+
$this->since_id = $this->trimmed('since_id');
$this->geocode = $this->trimmed('geocode');
@@ -127,9 +130,9 @@ class ApiSearchJSONAction extends ApiPrivateAuthAction
$cnt = $notice->find();
}
- // TODO: since_id, lang, geocode
+ // TODO: max_id, lang, geocode
- $results = new JSONSearchResultsList($notice, $q, $this->rpp, $this->page);
+ $results = new JSONSearchResultsList($notice, $q, $this->rpp, $this->page, $this->since_id);
$this->initDocument('json');
$results->show();
diff --git a/lib/jsonsearchresultslist.php b/lib/jsonsearchresultslist.php
index 0d72ddf7a..80d4036aa 100644
--- a/lib/jsonsearchresultslist.php
+++ b/lib/jsonsearchresultslist.php
@@ -101,6 +101,10 @@ class JSONSearchResultsList
$this->max_id = (int)$this->notice->id;
}
+ if ($this->since_id && $this->notice->id <= $this->since_id) {
+ break;
+ }
+
if ($cnt > $this->rpp) {
break;
}