Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x

This commit is contained in:
Zach Copley 2010-10-21 01:18:53 +00:00
commit 500157998a
12 changed files with 19 additions and 25 deletions

View File

@ -92,7 +92,6 @@ class ApiOauthAuthorizeAction extends Action
* *
* @return void * @return void
*/ */
function handle($args) function handle($args)
{ {
parent::handle($args); parent::handle($args);
@ -120,7 +119,7 @@ class ApiOauthAuthorizeAction extends Action
// Check to make sure we haven't already authorized the token // Check to make sure we haven't already authorized the token
if ($this->reqToken->state != 0) { if ($this->reqToken->state != 0) {
// TRANS: Client error given when an invalid request token was passed to the OAuth API. // TRANS: Client error given when an invalid request token was passed to the OAuth API.
$this->clientError(_("Invalid request token.")); $this->clientError(_('Invalid request token.'));
} }
} }
} }
@ -202,6 +201,7 @@ class ApiOauthAuthorizeAction extends Action
if (!$result) { if (!$result) {
common_log_db_error($tokenAssoc, 'INSERT', __FILE__); common_log_db_error($tokenAssoc, 'INSERT', __FILE__);
// TRANS: Server error displayed when a database action fails.
$this->serverError(_('Database error inserting oauth_token_association.')); $this->serverError(_('Database error inserting oauth_token_association.'));
} }
@ -251,16 +251,13 @@ class ApiOauthAuthorizeAction extends Action
// Otherwise, inform the user that the rt was authorized // Otherwise, inform the user that the rt was authorized
$this->showAuthorized(); $this->showAuthorized();
} else if ($this->arg('cancel')) { } else if ($this->arg('cancel')) {
try { try {
$this->store->revoke_token($this->oauthTokenParam, 0); $this->store->revoke_token($this->oauthTokenParam, 0);
$this->showCanceled(); $this->showCanceled();
} catch (Exception $e) { } catch (Exception $e) {
$this->ServerError($e->getMessage()); $this->ServerError($e->getMessage());
} }
} else { } else {
// TRANS: Client error given on when invalid data was passed through a form in the OAuth API. // TRANS: Client error given on when invalid data was passed through a form in the OAuth API.
$this->clientError(_('Unexpected form submission.')); $this->clientError(_('Unexpected form submission.'));
@ -310,7 +307,6 @@ class ApiOauthAuthorizeAction extends Action
* *
* @return string title of the page * @return string title of the page
*/ */
function title() function title()
{ {
// TRANS: Title for a page where a user can confirm/deny account access by an external application. // TRANS: Title for a page where a user can confirm/deny account access by an external application.
@ -322,7 +318,6 @@ class ApiOauthAuthorizeAction extends Action
* *
* @return void * @return void
*/ */
function showContent() function showContent()
{ {
$this->elementStart('form', array('method' => 'post', $this->elementStart('form', array('method' => 'post',

View File

@ -39,6 +39,4 @@ class Oauth_token_association extends Memcached_DataObject
return empty($result) ? null : $oau; return empty($result) ? null : $oau;
} }
} }

View File

@ -48,7 +48,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
$app = Oauth_application::getByConsumerKey('anonymous'); $app = Oauth_application::getByConsumerKey('anonymous');
if (!$app) { if (!$app) {
common_debug("API OAuth - creating anonymous application"); common_debug("API OAuth - creating anonymous application");
$app = new OAuth_application(); $app = new OAuth_application();
$app->owner = 1; // XXX: What to do here? $app->owner = 1; // XXX: What to do here?
@ -148,6 +147,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
if (!$tokenAssoc) { if (!$tokenAssoc) {
throw new Exception( throw new Exception(
// TRANS: Exception thrown when no token association could be found.
_('Could not find a profile and application associated with the request token.') _('Could not find a profile and application associated with the request token.')
); );
} }
@ -182,6 +182,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
if (!$result) { if (!$result) {
throw new Exception( throw new Exception(
// TRANS: Exception thrown when no access token can be issued.
_('Could not issue access token.') _('Could not issue access token.')
); );
} }
@ -238,6 +239,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
if (!$result) { if (!$result) {
common_log_db_error($appUser, 'INSERT', __FILE__); common_log_db_error($appUser, 'INSERT', __FILE__);
// TRANS: Server error displayed when a database error occurs.
$this->serverError(_('Database error inserting OAuth application user.')); $this->serverError(_('Database error inserting OAuth application user.'));
} }

View File

@ -47,7 +47,6 @@ require_once INSTALLDIR.'/lib/servererroraction.php';
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class DBErrorAction extends ServerErrorAction class DBErrorAction extends ServerErrorAction
{ {
function __construct($message='Error', $code=500) function __construct($message='Error', $code=500)

View File

@ -43,7 +43,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class Feed class Feed
{ {
const RSS1 = 1; const RSS1 = 1;

View File

@ -46,7 +46,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* *
* @see Action::showExportList() * @see Action::showExportList()
*/ */
class FeedList extends Widget class FeedList extends Widget
{ {
var $action = null; var $action = null;

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class GroupsByMembersSection extends GroupSection class GroupsByMembersSection extends GroupSection
{ {
function getGroups() function getGroups()
@ -68,6 +67,7 @@ class GroupsByMembersSection extends GroupSection
function title() function title()
{ {
// TRANS: Title for groups with the most members section.
return _('Groups with most members'); return _('Groups with most members');
} }

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class GroupsByPostsSection extends GroupSection class GroupsByPostsSection extends GroupSection
{ {
function getGroups() function getGroups()
@ -68,6 +67,7 @@ class GroupsByPostsSection extends GroupSection
function title() function title()
{ {
// TRANS: Title for groups with the most posts section.
return _('Groups with most posts'); return _('Groups with most posts');
} }

View File

@ -45,7 +45,6 @@ define('GROUPS_PER_SECTION', 6);
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class GroupSection extends Section class GroupSection extends Section
{ {
function showContent() function showContent()

View File

@ -40,7 +40,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class GroupTagCloudSection extends TagCloudSection class GroupTagCloudSection extends TagCloudSection
{ {
var $group = null; var $group = null;
@ -53,6 +52,8 @@ class GroupTagCloudSection extends TagCloudSection
function title() function title()
{ {
// TRANS: Title for group tag cloud section.
// TRANS: %s is a group name.
return sprintf(_('Tags in %s group\'s notices'), $this->group->nickname); return sprintf(_('Tags in %s group\'s notices'), $this->group->nickname);
} }

View File

@ -30,7 +30,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
* In a multi-site queuedaemon.php run, one connection will be instantiated * In a multi-site queuedaemon.php run, one connection will be instantiated
* for each site being handled by the current process that has XMPP enabled. * for each site being handled by the current process that has XMPP enabled.
*/ */
class XmppManager extends IoManager class XmppManager extends IoManager
{ {
protected $site = null; protected $site = null;
@ -102,6 +101,7 @@ class XmppManager extends IoManager
$this->conn->addEventHandler('reconnect', 'handle_reconnect', $this); $this->conn->addEventHandler('reconnect', 'handle_reconnect', $this);
$this->conn->setReconnectTimeout(600); $this->conn->setReconnectTimeout(600);
// @todo Needs i18n?
jabber_send_presence("Send me a message to post a notice", 'available', null, 'available', 100); jabber_send_presence("Send me a message to post a notice", 'available', null, 'available', 100);
return !is_null($this->conn); return !is_null($this->conn);
@ -281,9 +281,9 @@ class XmppManager extends IoManager
$_cur = $user; $_cur = $user;
if (!$user) { if (!$user) {
$this->from_site($from, 'Unknown user; go to ' . // TRANS: %s is the URL to the StatusNet site's Instant Messaging settings.
common_local_url('imsettings') . $this->from_site($from, sprintf(_('Unknown user. Go to %s ' .
' to add your address to your account'); 'to add your address to your account'),common_local_url('imsettings')));
$this->log(LOG_WARNING, 'Message from unknown user ' . $from); $this->log(LOG_WARNING, 'Message from unknown user ' . $from);
return; return;
} }
@ -314,7 +314,6 @@ class XmppManager extends IoManager
unset($pl); unset($pl);
} }
function is_self($from) function is_self($from)
{ {
return preg_match('/^'.strtolower(jabber_daemon_address()).'/', strtolower($from)); return preg_match('/^'.strtolower(jabber_daemon_address()).'/', strtolower($from));
@ -400,7 +399,11 @@ class XmppManager extends IoManager
$content_shortened = common_shorten_links($body); $content_shortened = common_shorten_links($body);
if (Notice::contentTooLong($content_shortened)) { if (Notice::contentTooLong($content_shortened)) {
$from = jabber_normalize_jid($pl['from']); $from = jabber_normalize_jid($pl['from']);
$this->from_site($from, sprintf(_('Message too long - maximum is %1$d characters, you sent %2$d.'), // TRANS: Response to XMPP source when it sent too long a message.
// TRANS: %1$d the maximum number of allowed characters (used for plural), %2$d is the sent number.
$this->from_site($from, sprintf(_m('Message too long. Maximum is %1$d character, you sent %2$d.',
'Message too long. Maximum is %1$d characters, you sent %2$d.',
Notice::maxContent()),
Notice::maxContent(), Notice::maxContent(),
mb_strlen($content_shortened))); mb_strlen($content_shortened)));
return; return;

View File

@ -52,4 +52,3 @@ class XmppOutQueueHandler extends QueueHandler
return $ok; return $ok;
} }
} }