]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
authorZach Copley <zach@status.net>
Thu, 21 Oct 2010 01:18:53 +0000 (01:18 +0000)
committerZach Copley <zach@status.net>
Thu, 21 Oct 2010 01:18:53 +0000 (01:18 +0000)
12 files changed:
actions/apioauthauthorize.php
classes/Oauth_token_association.php
lib/apioauthstore.php
lib/dberroraction.php
lib/feed.php
lib/feedlist.php
lib/groupsbymemberssection.php
lib/groupsbypostssection.php
lib/groupsection.php
lib/grouptagcloudsection.php
lib/xmppmanager.php
lib/xmppoutqueuehandler.php

index ca32c85408f2a6a86e9e50f75b3cb7ef83067993..013cca029e71360d521cdf0dae996c3ebe824f5d 100644 (file)
@@ -92,7 +92,6 @@ class ApiOauthAuthorizeAction extends Action
      *
      * @return void
      */
-
     function handle($args)
     {
         parent::handle($args);
@@ -120,7 +119,7 @@ class ApiOauthAuthorizeAction extends Action
                     // Check to make sure we haven't already authorized the token
                     if ($this->reqToken->state != 0) {
                         // 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) {
                 common_log_db_error($tokenAssoc, 'INSERT', __FILE__);
+                // TRANS: Server error displayed when a database action fails.
                 $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
             $this->showAuthorized();
-
         } else if ($this->arg('cancel')) {
-
             try {
                 $this->store->revoke_token($this->oauthTokenParam, 0);
                 $this->showCanceled();
             } catch (Exception $e) {
                 $this->ServerError($e->getMessage());
             }
-
         } else {
             // TRANS: Client error given on when invalid data was passed through a form in the OAuth API.
             $this->clientError(_('Unexpected form submission.'));
@@ -310,7 +307,6 @@ class ApiOauthAuthorizeAction extends Action
      *
      * @return string title of the page
      */
-
     function title()
     {
         // 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
      */
-
     function showContent()
     {
         $this->elementStart('form', array('method' => 'post',
index 05173271296c3c89765c00f8b8c7b930fc035431..66be22b5d3b7bc9b01b8390a691d57dadc971b67 100644 (file)
@@ -39,6 +39,4 @@ class Oauth_token_association extends Memcached_DataObject
 
         return empty($result) ? null : $oau;
     }
-
 }
-
index e67b864af64fae0d12681cf2d398ab4f996cada4..2a65fffc4bb3fa281d9a22fd518c58bd8acbd75c 100644 (file)
@@ -48,7 +48,6 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
                 $app = Oauth_application::getByConsumerKey('anonymous');
 
                 if (!$app) {
-
                     common_debug("API OAuth - creating anonymous application");
                     $app               = new OAuth_application();
                     $app->owner        = 1; // XXX: What to do here?
@@ -66,7 +65,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
                     $id = $app->insert();
 
                     if (!$id) {
-                                               // TRANS: Server error displayed when trying to create an anynymous OAuth application.
+                       // TRANS: Server error displayed when trying to create an anynymous OAuth application.
                         $this->serverError(_("Could not create anonymous OAuth application."));
                     }
                 }
@@ -148,6 +147,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
 
             if (!$tokenAssoc) {
                 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.')
                 );
             }
@@ -182,6 +182,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
 
                 if (!$result) {
                     throw new Exception(
+                        // TRANS: Exception thrown when no access token can be issued.
                         _('Could not issue access token.')
                     );
                 }
@@ -238,6 +239,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore
 
                 if (!$result) {
                     common_log_db_error($appUser, 'INSERT', __FILE__);
+                    // TRANS: Server error displayed when a database error occurs.
                     $this->serverError(_('Database error inserting OAuth application user.'));
                 }
 
index 2cb66a022ddcae11d970846d9f5ec12af0d1a4c6..0a6fce1005bb79fdfeece2450ec01a2c7d79d667 100644 (file)
@@ -47,7 +47,6 @@ require_once INSTALLDIR.'/lib/servererroraction.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-
 class DBErrorAction extends ServerErrorAction
 {
     function __construct($message='Error', $code=500)
index e9fb6fdff3e392620291763044858a603627d834..5902653679ab2ea914a3b341b14074c1a799f8db 100644 (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
  * @link     http://status.net/
  */
-
 class Feed
 {
     const RSS1 = 1;
index 4aacf0b3d84ac4f3a9a327c3be8c8ebe584015b9..076576028dc5884609af022fdd205543dc6ba247 100644 (file)
@@ -46,7 +46,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
  *
  * @see      Action::showExportList()
  */
-
 class FeedList extends Widget
 {
     var $action = null;
index 19b35eddb8aa5821906926977fde2cba1b6a6af1..5cf1a563c02c4f66bfe36e97e99dbc714e6d97fb 100644 (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
  * @link     http://status.net/
  */
-
 class GroupsByMembersSection extends GroupSection
 {
     function getGroups()
@@ -68,6 +67,7 @@ class GroupsByMembersSection extends GroupSection
 
     function title()
     {
+        // TRANS: Title for groups with the most members section.
         return _('Groups with most members');
     }
 
index 45d49aba6687b10dc7c0169c1db41d5e392cda53..50d60e87cbb226b0e95aaf66399b2e42e67693ff 100644 (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
  * @link     http://status.net/
  */
-
 class GroupsByPostsSection extends GroupSection
 {
     function getGroups()
@@ -68,6 +67,7 @@ class GroupsByPostsSection extends GroupSection
 
     function title()
     {
+        // TRANS: Title for groups with the most posts section.
         return _('Groups with most posts');
     }
 
index 3b0b3029dd19a87b7e6aead2427d2ae87cce0b71..019b131354f0750701e8dd149bab97d2fcd602ef 100644 (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
  * @link     http://status.net/
  */
-
 class GroupSection extends Section
 {
     function showContent()
index f1106cc7bf9caeb3151595e5e2d5b022ea8427c5..5b914c00734a972bed9111c4bfafbea7605a5b77 100644 (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
  * @link     http://status.net/
  */
-
 class GroupTagCloudSection extends TagCloudSection
 {
     var $group = null;
@@ -53,6 +52,8 @@ class GroupTagCloudSection extends TagCloudSection
 
     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);
     }
 
index 829eaa36cbe24a976acb671e43d8c03fa84a9722..7acd7663a220f5f4ec77a38ab7b1f219bb32a6f5 100644 (file)
@@ -30,7 +30,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
  * 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.
  */
-
 class XmppManager extends IoManager
 {
     protected $site = null;
@@ -102,6 +101,7 @@ class XmppManager extends IoManager
         $this->conn->addEventHandler('reconnect', 'handle_reconnect', $this);
 
         $this->conn->setReconnectTimeout(600);
+        // @todo Needs i18n?
         jabber_send_presence("Send me a message to post a notice", 'available', null, 'available', 100);
 
         return !is_null($this->conn);
@@ -281,9 +281,9 @@ class XmppManager extends IoManager
         $_cur = $user;
 
         if (!$user) {
-            $this->from_site($from, 'Unknown user; go to ' .
-                             common_local_url('imsettings') .
-                             ' to add your address to your account');
+            // TRANS: %s is the URL to the StatusNet site's Instant Messaging settings.
+            $this->from_site($from, sprintf(_('Unknown user. Go to %s ' .
+                             'to add your address to your account'),common_local_url('imsettings')));
             $this->log(LOG_WARNING, 'Message from unknown user ' . $from);
             return;
         }
@@ -314,7 +314,6 @@ class XmppManager extends IoManager
         unset($pl);
     }
 
-
     function is_self($from)
     {
         return preg_match('/^'.strtolower(jabber_daemon_address()).'/', strtolower($from));
@@ -400,7 +399,11 @@ class XmppManager extends IoManager
         $content_shortened = common_shorten_links($body);
         if (Notice::contentTooLong($content_shortened)) {
           $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(),
                                           mb_strlen($content_shortened)));
           return;
index 2afa260f183cbf3b61604c4bfbd8464932ddfa4e..a4c9bbc4d6805b26257a0941f8557927cdd799c7 100644 (file)
@@ -52,4 +52,3 @@ class XmppOutQueueHandler extends QueueHandler
         return $ok;
     }
 }
-