summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-08-03 16:05:03 -0700
committerEvan Prodromou <evan@status.net>2010-08-03 16:05:03 -0700
commit9f0715a9935966f3ec483bccc476d5baf3324b3c (patch)
tree9874247927e5e24044c75a48a9c04e427b0ba477 /actions
parent004e42e3e0606f0f9e5c8b6cd4512e5d870cd56e (diff)
parentb17fc0ca5b90d2cdc957ebc4870fbd2791b9e1b9 (diff)
Merge branch '0.9.x' into 1.0.x
Diffstat (limited to 'actions')
-rw-r--r--actions/all.php4
-rw-r--r--actions/apiaccountupdateprofilecolors.php6
-rw-r--r--actions/apiblockcreate.php4
-rw-r--r--actions/apiblockdestroy.php4
-rw-r--r--actions/apifriendshipscreate.php6
-rw-r--r--actions/apifriendshipsdestroy.php7
-rw-r--r--actions/apifriendshipsexists.php19
-rw-r--r--actions/apimediaupload.php6
-rw-r--r--actions/apistatusesupdate.php17
-rw-r--r--actions/apitimelinegroup.php6
-rw-r--r--actions/favor.php2
-rw-r--r--actions/finishremotesubscribe.php2
-rw-r--r--actions/nudge.php2
-rw-r--r--actions/replies.php6
-rw-r--r--actions/showfavorites.php6
-rw-r--r--actions/showstream.php4
16 files changed, 52 insertions, 49 deletions
diff --git a/actions/all.php b/actions/all.php
index 9c01b6393..6c14d2f13 100644
--- a/actions/all.php
+++ b/actions/all.php
@@ -143,10 +143,10 @@ class AllAction extends ProfileAction
$message .= _('Try subscribing to more people, [join a group](%%action.groups%%) or post something yourself.');
} else {
// TRANS: %1$s is user nickname, %2$s is user nickname, %2$s is user nickname prefixed with "@"
- $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
+ $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) from their profile or [post something to them](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
}
} else {
- $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
+ $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->user->nickname);
}
$this->elementStart('div', 'guide');
diff --git a/actions/apiaccountupdateprofilecolors.php b/actions/apiaccountupdateprofilecolors.php
index 3cac82974..c666f9d75 100644
--- a/actions/apiaccountupdateprofilecolors.php
+++ b/actions/apiaccountupdateprofilecolors.php
@@ -22,7 +22,7 @@
* @category API
* @package StatusNet
* @author Zach Copley <zach@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -131,7 +131,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
try {
$this->setColors($design);
} catch (WebColorException $e) {
- $this->clientError($e->getMessage());
+ $this->clientError($e->getMessage(), 400, $this->format);
return false;
}
@@ -153,7 +153,7 @@ class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
try {
$this->setColors($design);
} catch (WebColorException $e) {
- $this->clientError($e->getMessage());
+ $this->clientError($e->getMessage(), 400, $this->format);
return false;
}
diff --git a/actions/apiblockcreate.php b/actions/apiblockcreate.php
index c26485f59..b355cd1c7 100644
--- a/actions/apiblockcreate.php
+++ b/actions/apiblockcreate.php
@@ -23,7 +23,7 @@
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @author Zach Copley <zach@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -65,7 +65,7 @@ class ApiBlockCreateAction extends ApiAuthAction
parent::prepare($args);
$this->user = $this->auth_user;
- $this->other = $this->getTargetUser($this->arg('id'));
+ $this->other = $this->getTargetProfile($this->arg('id'));
return true;
}
diff --git a/actions/apiblockdestroy.php b/actions/apiblockdestroy.php
index 666f308f4..7ea201677 100644
--- a/actions/apiblockdestroy.php
+++ b/actions/apiblockdestroy.php
@@ -23,7 +23,7 @@
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @author Zach Copley <zach@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -64,7 +64,7 @@ class ApiBlockDestroyAction extends ApiAuthAction
parent::prepare($args);
$this->user = $this->auth_user;
- $this->other = $this->getTargetUser($this->arg('id'));
+ $this->other = $this->getTargetProfile($this->arg('id'));
return true;
}
diff --git a/actions/apifriendshipscreate.php b/actions/apifriendshipscreate.php
index 1de2cc32e..a7ec5b28a 100644
--- a/actions/apifriendshipscreate.php
+++ b/actions/apifriendshipscreate.php
@@ -24,7 +24,7 @@
* @author Dan Moore <dan@moore.cx>
* @author Evan Prodromou <evan@status.net>
* @author Zach Copley <zach@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -67,7 +67,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
parent::prepare($args);
$this->user = $this->auth_user;
- $this->other = $this->getTargetUser($id);
+ $this->other = $this->getTargetProfile($this->arg('id'));
return true;
}
@@ -106,7 +106,7 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
if (empty($this->other)) {
$this->clientError(
- _('Could not follow user: User not found.'),
+ _('Could not follow user: profile not found.'),
403,
$this->format
);
diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php
index d48a57756..551d01682 100644
--- a/actions/apifriendshipsdestroy.php
+++ b/actions/apifriendshipsdestroy.php
@@ -24,7 +24,7 @@
* @author Dan Moore <dan@moore.cx>
* @author Evan Prodromou <evan@status.net>
* @author Zach Copley <zach@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -67,7 +67,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
parent::prepare($args);
$this->user = $this->auth_user;
- $this->other = $this->getTargetUser($id);
+ $this->other = $this->getTargetProfile($this->arg('id'));
return true;
}
@@ -125,8 +125,7 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
}
// throws an exception on error
- Subscription::cancel($this->user->getProfile(),
- $this->other->getProfile());
+ Subscription::cancel($this->user->getProfile(), $this->other);
$this->initDocument($this->format);
$this->showProfile($this->other, $this->format);
diff --git a/actions/apifriendshipsexists.php b/actions/apifriendshipsexists.php
index ca62b5f51..725178fd4 100644
--- a/actions/apifriendshipsexists.php
+++ b/actions/apifriendshipsexists.php
@@ -24,7 +24,7 @@
* @author Dan Moore <dan@moore.cx>
* @author Evan Prodromou <evan@status.net>
* @author Zach Copley <zach@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -50,8 +50,8 @@ require_once INSTALLDIR . '/lib/apiprivateauth.php';
class ApiFriendshipsExistsAction extends ApiPrivateAuthAction
{
- var $user_a = null;
- var $user_b = null;
+ var $profile_a = null;
+ var $profile_b = null;
/**
* Take arguments for running
@@ -66,11 +66,8 @@ class ApiFriendshipsExistsAction extends ApiPrivateAuthAction
{
parent::prepare($args);
- $user_a_id = $this->trimmed('user_a');
- $user_b_id = $this->trimmed('user_b');
-
- $this->user_a = $this->getTargetUser($user_a_id);
- $this->user_b = $this->getTargetUser($user_b_id);
+ $this->profile_a = $this->getTargetProfile($this->trimmed('user_a'));
+ $this->profile_b = $this->getTargetProfile($this->trimmed('user_b'));
return true;
}
@@ -89,16 +86,16 @@ class ApiFriendshipsExistsAction extends ApiPrivateAuthAction
{
parent::handle($args);
- if (empty($this->user_a) || empty($this->user_b)) {
+ if (empty($this->profile_a) || empty($this->profile_b)) {
$this->clientError(
- _('Two user ids or screen_names must be supplied.'),
+ _('Two valid IDs or screen_names must be supplied.'),
400,
$this->format
);
return;
}
- $result = $this->user_a->isSubscribed($this->user_b);
+ $result = Subscription::exists($this->profile_a, $this->profile_b);
switch ($this->format) {
case 'xml':
diff --git a/actions/apimediaupload.php b/actions/apimediaupload.php
index ec316edc8..7aa88c186 100644
--- a/actions/apimediaupload.php
+++ b/actions/apimediaupload.php
@@ -88,15 +88,15 @@ class ApiMediaUploadAction extends ApiAuthAction
try {
$upload = MediaFile::fromUpload('media', $this->auth_user);
- } catch (ClientException $ce) {
- $this->clientError($ce->getMessage());
+ } catch (Exception $e) {
+ $this->clientError($e->getMessage(), $e->getCode());
return;
}
if (isset($upload)) {
$this->showResponse($upload);
} else {
- $this->clientError('Upload failed.');
+ $this->clientError(_('Upload failed.'));
return;
}
}
diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php
index d65a068f5..fa3f611c0 100644
--- a/actions/apistatusesupdate.php
+++ b/actions/apistatusesupdate.php
@@ -196,7 +196,8 @@ class ApiStatusesUpdateAction extends ApiAuthAction
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
_('This method requires a POST.'),
- 400, $this->format
+ 400,
+ $this->format
);
return;
}
@@ -217,7 +218,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
if (empty($this->status)) {
$this->clientError(
- 'Client must provide a \'status\' parameter with a value.',
+ _('Client must provide a \'status\' parameter with a value.'),
400,
$this->format
);
@@ -291,8 +292,8 @@ class ApiStatusesUpdateAction extends ApiAuthAction
try {
$upload = MediaFile::fromUpload('media', $this->auth_user);
- } catch (ClientException $ce) {
- $this->clientError($ce->getMessage());
+ } catch (Exception $e) {
+ $this->clientError($e->getMessage(), $e->getCode(), $this->format);
return;
}
@@ -305,7 +306,11 @@ class ApiStatusesUpdateAction extends ApiAuthAction
'Max notice size is %d chars, ' .
'including attachment URL.'
);
- $this->clientError(sprintf($msg, Notice::maxContent()));
+ $this->clientError(
+ sprintf($msg, Notice::maxContent()),
+ 400,
+ $this->format
+ );
}
}
@@ -332,7 +337,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
$options
);
} catch (Exception $e) {
- $this->clientError($e->getMessage());
+ $this->clientError($e->getMessage(), $e->getCode(), $this->format);
return;
}
diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php
index c4a6a18d2..7a40fd808 100644
--- a/actions/apitimelinegroup.php
+++ b/actions/apitimelinegroup.php
@@ -25,7 +25,7 @@
* @author Evan Prodromou <evan@status.net>
* @author Jeffery To <jeffery.to@gmail.com>
* @author Zach Copley <zach@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2010 StatusNet, Inc.
* @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
@@ -138,7 +138,9 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
$this->raw($atom->getString());
} catch (Atom10FeedException $e) {
$this->serverError(
- 'Could not generate feed for group - ' . $e->getMessage()
+ 'Could not generate feed for group - ' . $e->getMessage(),
+ 400,
+ $this->format
);
return;
}
diff --git a/actions/favor.php b/actions/favor.php
index 475912fd0..01976a38f 100644
--- a/actions/favor.php
+++ b/actions/favor.php
@@ -104,7 +104,7 @@ class FavorAction extends Action
}
/**
- * Notifies a user when his notice is favorited.
+ * Notifies a user when their notice is favorited.
*
* @param class $notice favorited notice
* @param class $user user declaring a favorite
diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php
index ac51ddec3..0325f6adb 100644
--- a/actions/finishremotesubscribe.php
+++ b/actions/finishremotesubscribe.php
@@ -37,7 +37,7 @@ require_once INSTALLDIR.'/lib/omb.php';
* Handler for remote subscription finish callback
*
* When a remote user subscribes a local user, a redirect to this action is
- * issued after the remote user authorized his service to subscribe.
+ * issued after the remote user authorized their service to subscribe.
*
* @category Action
* @package Laconica
diff --git a/actions/nudge.php b/actions/nudge.php
index cf5f773e7..32ae8587c 100644
--- a/actions/nudge.php
+++ b/actions/nudge.php
@@ -82,7 +82,7 @@ class NudgeAction extends Action
}
if (!$other->email || !$other->emailnotifynudge) {
- $this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set his email yet.'));
+ $this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set their email yet.'));
return;
}
diff --git a/actions/replies.php b/actions/replies.php
index 608f71d6e..8f2fc6c7f 100644
--- a/actions/replies.php
+++ b/actions/replies.php
@@ -196,18 +196,18 @@ class RepliesAction extends OwnerDesignAction
function showEmptyListMessage()
{
- $message = sprintf(_('This is the timeline showing replies to %1$s but %2$s hasn\'t received a notice to his attention yet.'), $this->user->nickname, $this->user->nickname) . ' ';
+ $message = sprintf(_('This is the timeline showing replies to %1$s but %2$s hasn\'t received a notice to them yet.'), $this->user->nickname, $this->user->nickname) . ' ';
if (common_logged_in()) {
$current_user = common_current_user();
if ($this->user->id === $current_user->id) {
$message .= _('You can engage other users in a conversation, subscribe to more people or [join groups](%%action.groups%%).');
} else {
- $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
+ $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) or [post something to them](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
}
}
else {
- $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
+ $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->user->nickname);
}
$this->elementStart('div', 'guide');
diff --git a/actions/showfavorites.php b/actions/showfavorites.php
index 7f3c77ee2..d8042e91c 100644
--- a/actions/showfavorites.php
+++ b/actions/showfavorites.php
@@ -119,7 +119,7 @@ class ShowfavoritesAction extends OwnerDesignAction
if (!empty($cur) && $cur->id == $this->user->id) {
// Show imported/gateway notices as well as local if
- // the user is looking at his own favorites
+ // the user is looking at their own favorites
$this->notice = $this->user->favoriteNotices(true, ($this->page-1)*NOTICES_PER_PAGE,
NOTICES_PER_PAGE + 1);
@@ -205,11 +205,11 @@ class ShowfavoritesAction extends OwnerDesignAction
if ($this->user->id === $current_user->id) {
$message = _('You haven\'t chosen any favorite notices yet. Click the fave button on notices you like to bookmark them for later or shed a spotlight on them.');
} else {
- $message = sprintf(_('%s hasn\'t added any notices to his favorites yet. Post something interesting they would add to their favorites :)'), $this->user->nickname);
+ $message = sprintf(_('%s hasn\'t added any favorite notices yet. Post something interesting they would add to their favorites :)'), $this->user->nickname);
}
}
else {
- $message = sprintf(_('%s hasn\'t added any notices to his favorites yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to their favorites :)'), $this->user->nickname);
+ $message = sprintf(_('%s hasn\'t added any favorite notices yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to their favorites :)'), $this->user->nickname);
}
$this->elementStart('div', 'guide');
diff --git a/actions/showstream.php b/actions/showstream.php
index 5a9add36c..744b6906e 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -198,11 +198,11 @@ class ShowstreamAction extends ProfileAction
if ($this->user->id === $current_user->id) {
$message .= _('Seen anything interesting recently? You haven\'t posted any notices yet, now would be a good time to start :)');
} else {
- $message .= sprintf(_('You can try to nudge %1$s or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%2$s).'), $this->user->nickname, '@' . $this->user->nickname);
+ $message .= sprintf(_('You can try to nudge %1$s or [post something to them](%%%%action.newnotice%%%%?status_textarea=%2$s).'), $this->user->nickname, '@' . $this->user->nickname);
}
}
else {
- $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
+ $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->user->nickname);
}
$this->elementStart('div', 'guide');