summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/all.php22
-rw-r--r--actions/apidirectmessage.php5
-rw-r--r--actions/apigrouplist.php3
-rw-r--r--actions/apigroupmembership.php3
-rw-r--r--actions/apitimelinefriends.php4
-rw-r--r--actions/apitimelinegroup.php3
-rw-r--r--actions/apitimelinehome.php4
-rw-r--r--actions/apitimelinementions.php2
-rw-r--r--actions/apitimelinepublic.php4
-rw-r--r--actions/apitimelineuser.php2
-rw-r--r--actions/newnotice.php3
-rw-r--r--actions/postnotice.php11
-rw-r--r--actions/updateprofile.php10
13 files changed, 46 insertions, 30 deletions
diff --git a/actions/all.php b/actions/all.php
index 488d00e2b..8c22e6f5f 100644
--- a/actions/all.php
+++ b/actions/all.php
@@ -152,18 +152,22 @@ class AllAction extends ProfileAction
function showContent()
{
- $nl = new NoticeList($this->notice, $this);
+ if (Event::handle('StartShowAllContent', array($this))) {
+ $nl = new NoticeList($this->notice, $this);
- $cnt = $nl->show();
+ $cnt = $nl->show();
- if (0 == $cnt) {
- $this->showEmptyListMessage();
- }
+ if (0 == $cnt) {
+ $this->showEmptyListMessage();
+ }
- $this->pagination(
- $this->page > 1, $cnt > NOTICES_PER_PAGE,
- $this->page, 'all', array('nickname' => $this->user->nickname)
- );
+ $this->pagination(
+ $this->page > 1, $cnt > NOTICES_PER_PAGE,
+ $this->page, 'all', array('nickname' => $this->user->nickname)
+ );
+
+ Event::handle('EndShowAllContent', array($this));
+ }
}
function showPageTitle()
diff --git a/actions/apidirectmessage.php b/actions/apidirectmessage.php
index 5355acf82..53da9e0c6 100644
--- a/actions/apidirectmessage.php
+++ b/actions/apidirectmessage.php
@@ -182,11 +182,6 @@ class ApiDirectMessageAction extends ApiAuthAction
$message->whereAdd('id > ' . $this->since_id);
}
- if (!empty($since)) {
- $d = date('Y-m-d H:i:s', $this->since);
- $message->whereAdd("created > '$d'");
- }
-
$message->orderBy('created DESC, id DESC');
$message->limit((($this->page - 1) * $this->count), $this->count);
$message->find();
diff --git a/actions/apigrouplist.php b/actions/apigrouplist.php
index 605b38232..98fdb0497 100644
--- a/actions/apigrouplist.php
+++ b/actions/apigrouplist.php
@@ -152,8 +152,7 @@ class ApiGroupListAction extends ApiBareAuthAction
($this->page - 1) * $this->count,
$this->count,
$this->since_id,
- $this->max_id,
- $this->since
+ $this->max_id
);
while ($group->fetch()) {
diff --git a/actions/apigroupmembership.php b/actions/apigroupmembership.php
index 3c7c8e883..9f72b527c 100644
--- a/actions/apigroupmembership.php
+++ b/actions/apigroupmembership.php
@@ -125,8 +125,7 @@ class ApiGroupMembershipAction extends ApiPrivateAuthAction
($this->page - 1) * $this->count,
$this->count,
$this->since_id,
- $this->max_id,
- $this->since
+ $this->max_id
);
while ($profile->fetch()) {
diff --git a/actions/apitimelinefriends.php b/actions/apitimelinefriends.php
index 2db76857e..9ef3ace60 100644
--- a/actions/apitimelinefriends.php
+++ b/actions/apitimelinefriends.php
@@ -202,11 +202,11 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
if (!empty($this->auth_user) && $this->auth_user->id == $this->user->id) {
$notice = $this->user->ownFriendsTimeline(($this->page-1) * $this->count,
$this->count, $this->since_id,
- $this->max_id, $this->since);
+ $this->max_id);
} else {
$notice = $this->user->friendsTimeline(($this->page-1) * $this->count,
$this->count, $this->since_id,
- $this->max_id, $this->since);
+ $this->max_id);
}
while ($notice->fetch()) {
diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php
index 04456ffea..d0af49844 100644
--- a/actions/apitimelinegroup.php
+++ b/actions/apitimelinegroup.php
@@ -204,8 +204,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
($this->page-1) * $this->count,
$this->count,
$this->since_id,
- $this->max_id,
- $this->since
+ $this->max_id
);
while ($notice->fetch()) {
diff --git a/actions/apitimelinehome.php b/actions/apitimelinehome.php
index 0c72f4020..abd387786 100644
--- a/actions/apitimelinehome.php
+++ b/actions/apitimelinehome.php
@@ -200,13 +200,13 @@ class ApiTimelineHomeAction extends ApiBareAuthAction
$notice = $this->user->noticeInbox(
($this->page-1) * $this->count,
$this->count, $this->since_id,
- $this->max_id, $this->since
+ $this->max_id
);
} else {
$notice = $this->user->noticesWithFriends(
($this->page-1) * $this->count,
$this->count, $this->since_id,
- $this->max_id, $this->since
+ $this->max_id
);
}
diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php
index a39c63346..31627ab7b 100644
--- a/actions/apitimelinementions.php
+++ b/actions/apitimelinementions.php
@@ -189,7 +189,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
$notice = $this->user->getReplies(
($this->page - 1) * $this->count, $this->count,
- $this->since_id, $this->max_id, $this->since
+ $this->since_id, $this->max_id
);
while ($notice->fetch()) {
diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php
index 1ff0fd261..3e4dad690 100644
--- a/actions/apitimelinepublic.php
+++ b/actions/apitimelinepublic.php
@@ -75,10 +75,6 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
$this->notices = $this->getNotices();
- if ($this->since) {
- throw new ServerException("since parameter is disabled for performance; use since_id", 403);
- }
-
return true;
}
diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php
index b3ded97c0..94491946c 100644
--- a/actions/apitimelineuser.php
+++ b/actions/apitimelineuser.php
@@ -211,7 +211,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
$notice = $this->user->getNotices(
($this->page-1) * $this->count, $this->count,
- $this->since_id, $this->max_id, $this->since
+ $this->since_id, $this->max_id
);
while ($notice->fetch()) {
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 78480abab..ed0fa1b2b 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -294,6 +294,9 @@ class NewnoticeAction extends Action
if ($profile) {
$content = '@' . $profile->nickname . ' ';
}
+ } else {
+ // @fixme most of these bits above aren't being passed on above
+ $inreplyto = null;
}
$notice_form = new NoticeForm($this, '', $content, null, $inreplyto);
diff --git a/actions/postnotice.php b/actions/postnotice.php
index fb0670376..b2f6f1bb9 100644
--- a/actions/postnotice.php
+++ b/actions/postnotice.php
@@ -54,7 +54,10 @@ class PostnoticeAction extends Action
*/
function prepare($argarray)
{
+ StatusNet::setApi(true); // Send smaller error pages
+
parent::prepare($argarray);
+
try {
$this->checkNotice();
} catch (Exception $e) {
@@ -71,6 +74,14 @@ class PostnoticeAction extends Action
$srv = new OMB_Service_Provider(null, omb_oauth_datastore(),
omb_oauth_server());
$srv->handlePostNotice();
+ } catch (OMB_RemoteServiceException $rse) {
+ $msg = $rse->getMessage();
+ if (preg_match('/Revoked accesstoken/', $msg) ||
+ preg_match('/No subscriber/', $msg)) {
+ $this->clientError($msg, 403);
+ } else {
+ $this->clientError($msg);
+ }
} catch (Exception $e) {
$this->serverError($e->getMessage());
return;
diff --git a/actions/updateprofile.php b/actions/updateprofile.php
index e416a6fa9..bae6108cc 100644
--- a/actions/updateprofile.php
+++ b/actions/updateprofile.php
@@ -55,6 +55,8 @@ class UpdateprofileAction extends Action
*/
function prepare($argarray)
{
+ StatusNet::setApi(true); // Send smaller error pages
+
parent::prepare($argarray);
$license = $_POST['omb_listenee_license'];
$site_license = common_config('license', 'url');
@@ -75,6 +77,14 @@ class UpdateprofileAction extends Action
$srv = new OMB_Service_Provider(null, omb_oauth_datastore(),
omb_oauth_server());
$srv->handleUpdateProfile();
+ } catch (OMB_RemoteServiceException $rse) {
+ $msg = $rse->getMessage();
+ if (preg_match('/Revoked accesstoken/', $msg) ||
+ preg_match('/No subscriber/', $msg)) {
+ $this->clientError($msg, 403);
+ } else {
+ $this->clientError($msg);
+ }
} catch (Exception $e) {
$this->serverError($e->getMessage());
return;