]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
authorBrion Vibber <brion@pobox.com>
Fri, 26 Feb 2010 20:33:50 +0000 (12:33 -0800)
committerBrion Vibber <brion@pobox.com>
Fri, 26 Feb 2010 20:33:50 +0000 (12:33 -0800)
51 files changed:
actions/apiaccountupdateprofile.php
actions/apigroupshow.php
actions/apioauthauthorize.php
actions/apistatusnetconfig.php
actions/confirmaddress.php
actions/othersettings.php
actions/version.php
classes/File.php
db/08to09.sql
lib/apiaction.php
lib/authenticationplugin.php
lib/authorizationplugin.php
lib/command.php
lib/commandinterpreter.php
lib/default.php
lib/htmloutputter.php
lib/imagefile.php
lib/iomaster.php
lib/queuemanager.php
lib/subs.php
lib/util.php
locale/fr/LC_MESSAGES/statusnet.po
locale/mk/LC_MESSAGES/statusnet.po
locale/nl/LC_MESSAGES/statusnet.po
locale/pl/LC_MESSAGES/statusnet.po
locale/ru/LC_MESSAGES/statusnet.po
locale/statusnet.po
locale/uk/LC_MESSAGES/statusnet.po
plugins/Autocomplete/jquery-autocomplete/indicator.gif [new file with mode: 0644]
plugins/Comet/CometPlugin.php
plugins/Facebook/FacebookPlugin.php
plugins/Facebook/facebookaction.php
plugins/Imap/ImapPlugin.php
plugins/LdapAuthentication/LdapAuthenticationPlugin.php
plugins/LdapAuthentication/README
plugins/LdapAuthorization/LdapAuthorizationPlugin.php
plugins/LdapAuthorization/README
plugins/Minify/MinifyPlugin.php
plugins/OStatus/OStatusPlugin.php
plugins/OpenID/OpenIDPlugin.php
plugins/Orbited/OrbitedPlugin.php
plugins/README-plugins [new file with mode: 0644]
plugins/Realtime/RealtimePlugin.php
plugins/Realtime/realtimeupdate.js
plugins/Recaptcha/RecaptchaPlugin.php
plugins/ReverseUsernameAuthentication/README
plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php
plugins/TabFocus/TabFocusPlugin.php [new file with mode: 0644]
plugins/TabFocus/tabfocus.js [new file with mode: 0644]
plugins/TwitterBridge/twitter.php
scripts/useremail.php

index fd4384a25c465093f042cdeee6c4650ede04b245..9b371ea95764e1f829e7c9bce1eba8cffcb3859a 100644 (file)
@@ -115,11 +115,11 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
 
         $original = clone($profile);
 
-        if (empty($this->name)) {
+        if (!empty($this->name)) {
             $profile->fullname = $this->name;
         }
 
-        if (empty($this->url)) {
+        if (!empty($this->url)) {
             $profile->homepage = $this->url;
         }
 
index 95d6f95afa8a18be770d5d8a0d00225563638d16..5745a81f4172e6572694bba3b12ccb1ea638f8ed 100644 (file)
@@ -45,6 +45,7 @@ require_once INSTALLDIR . '/lib/apiprivateauth.php';
  * @author   Evan Prodromou <evan@status.net>
  * @author   Jeffery To <jeffery.to@gmail.com>
  * @author   Zach Copley <zach@status.net>
+ * @author   Michele <macno@macno.org>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
@@ -68,6 +69,24 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
 
         $this->group = $this->getTargetGroup($this->arg('id'));
 
+        if (empty($this->group)) {
+            $alias = Group_alias::staticGet(
+                'alias',
+                common_canonical_nickname($this->arg('id'))
+            );
+            if (!empty($alias)) {
+                $args = array('id' => $alias->group_id, 'format' => $this->format);
+                common_redirect(common_local_url('ApiGroupShow', $args), 301);
+            } else {
+                $this->clientError(
+                    _('Group not found!'),
+                    404,
+                    $this->format
+                );
+            }
+            return;
+        }
+
         return true;
     }
 
@@ -85,15 +104,6 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
     {
         parent::handle($args);
 
-        if (empty($this->group)) {
-            $this->clientError(
-                _('Group not found!'),
-                404,
-                $this->format
-            );
-            return;
-        }
-
         switch($this->format) {
         case 'xml':
             $this->showSingleXmlGroup($this->group);
@@ -105,7 +115,6 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
             $this->clientError(_('API method not found.'), 404, $this->format);
             break;
         }
-
     }
 
     /**
index 2caa8d20b33a36ced4c703bbf66fc40c0a607799..e7c6f376116d636bdd42c05d55ecb6b00c306739 100644 (file)
@@ -156,7 +156,7 @@ class ApiOauthAuthorizeAction extends ApiOauthAction
 
                 if (!$result) {
                     common_log_db_error($appUser, 'DELETE', __FILE__);
-                    throw new ServerException(_('DB error deleting OAuth app user.'));
+                    throw new ServerException(_('Database error deleting OAuth application user.'));
                     return;
                 }
             }
@@ -182,7 +182,7 @@ class ApiOauthAuthorizeAction extends ApiOauthAction
 
             if (!$result) {
                 common_log_db_error($appUser, 'INSERT', __FILE__);
-                throw new ServerException(_('DB error inserting OAuth app user.'));
+                throw new ServerException(_('Database error inserting OAuth application user.'));
                 return;
             }
 
index 296376d1955095b7f232aa018d9d5144aaef12d8..bff8313b5c55e993165ee7a798f015ae8e6fb90f 100644 (file)
@@ -50,13 +50,17 @@ if (!defined('STATUSNET')) {
 class ApiStatusnetConfigAction extends ApiAction
 {
     var $keys = array(
-        'site' => array('name', 'server', 'theme', 'path', 'fancy', 'language',
-                        'email', 'broughtby', 'broughtbyurl', 'closed',
-                        'inviteonly', 'private'),
-        'license' => array('url', 'title', 'image'),
+        'site' => array('name', 'server', 'theme', 'path', 'logo', 'fancy', 'language',
+                        'email', 'broughtby', 'broughtbyurl', 'timezone', 'closed',
+                        'inviteonly', 'private', 'textlimit', 'ssl', 'sslserver', 'shorturllength'),
+        'license' => array('type', 'owner', 'url', 'title', 'image'),
         'nickname' => array('featured'),
+        'profile' => array('biolimit'),
+        'group' => array('desclimit'),
+        'notice' => array('contentlimit'),
         'throttle' => array('enabled', 'count', 'timespan'),
-        'xmpp' => array('enabled', 'server', 'user')
+        'xmpp' => array('enabled', 'server', 'port', 'user'),
+        'integration' => array('source')
     );
 
     /**
index 6fd74f3ff7889bf40e55d9df9343edecb0d10e6c..cc8351d8dcc0309ae593b77e120688fb571602c9 100644 (file)
@@ -141,7 +141,7 @@ class ConfirmaddressAction extends Action
 
     function title()
     {
-        return _('Confirm Address');
+        return _('Confirm address');
     }
 
     /**
index 0de7cd90860b1a7cc26198a4e033c5820bb4ef5a..10e9873b390b16f6cbc7e0d849a0c6d770a9814a 100644 (file)
@@ -57,7 +57,7 @@ class OthersettingsAction extends AccountSettingsAction
 
     function title()
     {
-        return _('Other Settings');
+        return _('Other settings');
     }
 
     /**
index c1f673c45c04844db093dccb2c7c9304c4bad3a2..b6593e5edb09cbdfe061201abf2ad13d2fcd1c49 100644 (file)
@@ -266,5 +266,6 @@ class VersionAction extends Action
                               'Craig Andrews',
                               'mEDI',
                               'Brett Taylor',
-                              'Brigitte Schuster');
+                              'Brigitte Schuster',
+                              'Brion Vibber');
 }
index 91b12d2e28664e61206aadb9abb4e8301fe21441..189e04ce021d77dc74a29ee14dbb64df118b4c2e 100644 (file)
@@ -279,6 +279,8 @@ class File extends Memcached_DataObject
                         if($oembed->modified) $enclosure->modified=$oembed->modified;
                         unset($oembed->size);
                     }
+                } else {
+                    return false;
                 }
             }
         }
index b10e47dbcb67f769f1577c046c9222e0e772c600..d5f30a26b99e449c62b9c8522ff1518bd96c8139 100644 (file)
@@ -110,3 +110,34 @@ insert into queue_item_new (frame,transport,created,claimed)
 alter table queue_item rename to queue_item_old;
 alter table queue_item_new rename to queue_item;
 
+alter table consumer
+    add column  consumer_secret varchar(255) not null comment 'secret value';
+
+create table oauth_application (
+    id integer auto_increment primary key comment 'unique identifier',
+    owner integer not null comment 'owner of the application' references profile (id),
+    consumer_key varchar(255) not null comment 'application consumer key' references consumer (consumer_key),
+    name varchar(255) not null comment 'name of the application',
+    description varchar(255) comment 'description of the application',
+    icon varchar(255) not null comment 'application icon',
+    source_url varchar(255) comment 'application homepage - used for source link',
+    organization varchar(255) comment 'name of the organization running the application',
+    homepage varchar(255) comment 'homepage for the organization',
+    callback_url varchar(255) comment 'url to redirect to after authentication',
+    type tinyint default 0 comment 'type of app, 1 = browser, 2 = desktop',
+    access_type tinyint default 0 comment 'default access type, bit 1 = read, bit 2 = write',
+    created datetime not null comment 'date this record was created',
+    modified timestamp comment 'date this record was modified'
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table oauth_application_user (
+    profile_id integer not null comment 'user of the application' references profile (id),
+    application_id integer not null comment 'id of the application' references oauth_application (id),
+    access_type tinyint default 0 comment 'access type, bit 1 = read, bit 2 = write, bit 3 = revoked',
+    token varchar(255) comment 'request or access token',
+    created datetime not null comment 'date this record was created',
+    modified timestamp comment 'date this record was modified',
+    constraint primary key (profile_id, application_id)
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+
index 2af150ab994d6f5bc9c60a849fadf0c7c715be41..9bfca3b66e49b643c403714c02744dd4ca0363fd 100644 (file)
@@ -289,11 +289,12 @@ class ApiAction extends Action
             $twitter_status['attachments'] = array();
 
             foreach ($attachments as $attachment) {
-                if ($attachment->isEnclosure()) {
+                $enclosure_o=$attachment->getEnclosure();
+                if ($enclosure_o) {
                     $enclosure = array();
-                    $enclosure['url'] = $attachment->url;
-                    $enclosure['mimetype'] = $attachment->mimetype;
-                    $enclosure['size'] = $attachment->size;
+                    $enclosure['url'] = $enclosure_o->url;
+                    $enclosure['mimetype'] = $enclosure_o->mimetype;
+                    $enclosure['size'] = $enclosure_o->size;
                     $twitter_status['attachments'][] = $enclosure;
                 }
             }
index de479a5768081b42648b60c219b6c1d1be51c3dc..5be3ea5b90795c360f3865e506f9f265b835135d 100644 (file)
@@ -69,13 +69,17 @@ abstract class AuthenticationPlugin extends Plugin
     /**
     * Automatically register a user when they attempt to login with valid credentials.
     * User::register($data) is a very useful method for this implementation
-    * @param username
+    * @param username username (that is used to login and find the user in the authentication provider) of the user to be registered
+    * @param nickname nickname of the user in the SN system. If nickname is null, then set nickname = username
     * @return mixed instance of User, or false (if user couldn't be created)
     */
-    function autoRegister($username)
+    function autoRegister($username, $nickname = null)
     {
+        if(is_null($nickname)){
+            $nickname = $username;
+        }
         $registration_data = array();
-        $registration_data['nickname'] = $username ;
+        $registration_data['nickname'] = $nickname ;
         return User::register($registration_data);
     }
 
@@ -92,6 +96,19 @@ abstract class AuthenticationPlugin extends Plugin
         return false;
     }
 
+    /**
+    * Given a username, suggest what the nickname should be
+    * Used during autoregistration
+    * Useful if your usernames are ugly, and you want to suggest
+    * nice looking nicknames when users initially sign on
+    * @param username
+    * @return string nickname
+    */
+    function suggestNicknameForUsername($username)
+    {
+        return $username;
+    }
+
     //------------Below are the methods that connect StatusNet to the implementing Auth plugin------------\\
     function onInitializePlugin(){
         if(!isset($this->provider_name)){
@@ -108,10 +125,22 @@ abstract class AuthenticationPlugin extends Plugin
     function onAutoRegister($nickname, $provider_name, &$user)
     {
         if($provider_name == $this->provider_name && $this->autoregistration){
-            $user = $this->autoregister($nickname);
-            if($user){
-                User_username::register($user,$nickname,$this->provider_name);
-                return false;
+            $suggested_nickname = $this->suggestNicknameForUsername($nickname);
+            $test_user = User::staticGet('nickname', $suggested_nickname);
+            if($test_user) {
+                //someone already exists with the suggested nickname, so used the passed nickname
+                $suggested_nickname = $nickname;
+            }
+            $test_user = User::staticGet('nickname', $suggested_nickname);
+            if($test_user) {
+                //someone already exists with the suggested nickname
+                //not much else we can do
+            }else{
+                $user = $this->autoRegister($nickname, $suggested_nickname);
+                if($user){
+                    User_username::register($user,$nickname,$this->provider_name);
+                    return false;
+                }
             }
         }
     }
@@ -122,23 +151,30 @@ abstract class AuthenticationPlugin extends Plugin
         $user_username->username=$nickname;
         $user_username->provider_name=$this->provider_name;
         if($user_username->find() && $user_username->fetch()){
-            $username = $user_username->username;
-            $authenticated = $this->checkPassword($username, $password);
+            $authenticated = $this->checkPassword($user_username->username, $password);
             if($authenticated){
                 $authenticatedUser = User::staticGet('id', $user_username->user_id);
                 return false;
             }
         }else{
-            $user = User::staticGet('nickname', $nickname);
+            //$nickname is the username used to login
+            //$suggested_nickname is the nickname the auth provider suggests for that username
+            $suggested_nickname = $this->suggestNicknameForUsername($nickname);
+            $user = User::staticGet('nickname', $suggested_nickname);
             if($user){
-                //make sure a different provider isn't handling this nickname
+                //make sure this user isn't claimed
                 $user_username = new User_username();
-                $user_username->username=$nickname;
-                if(!$user_username->find()){
-                    //no other provider claims this username, so it's safe for us to handle it
+                $user_username->user_id=$user->id;
+                $we_can_handle = false;
+                if($user_username->find()){
+                    //either this provider, or another one, has already claimed this user
+                    //so we cannot. Let another plugin try.
+                    return;
+                }else{
+                    //no other provider claims this user, so it's safe for us to handle it
                     $authenticated = $this->checkPassword($nickname, $password);
                     if($authenticated){
-                        $authenticatedUser = User::staticGet('nickname', $nickname);
+                        $authenticatedUser = $user;
                         User_username::register($authenticatedUser,$nickname,$this->provider_name);
                         return false;
                     }
index 733b0c065652a608c0670f38c84a20f54ee82b7d..07da9b2d12c785d57cf3a903bf7aa766341f1b37 100644 (file)
@@ -85,7 +85,7 @@ abstract class AuthorizationPlugin extends Plugin
     }
 
     function onStartSetApiUser(&$user) {
-        return $this->onStartSetUser(&$user);
+        return $this->onStartSetUser($user);
     }
 
     function onStartHasRole($profile, $name, &$has_role) {
index ea7b60372d96542dd134069d7a94b67b4d40756c..db8e8003041f0d2cdfc35cc10d8a259b42364e7a 100644 (file)
@@ -668,6 +668,34 @@ class LoginCommand extends Command
     }
 }
 
+class LoseCommand extends Command
+{
+
+    var $other = null;
+
+    function __construct($user, $other)
+    {
+        parent::__construct($user);
+        $this->other = $other;
+    }
+
+    function execute($channel)
+    {
+        if(!$this->other) {
+            $channel->error($this->user, _('Specify the name of the user to unsubscribe from'));
+            return;
+        }
+
+        $result=subs_unsubscribe_from($this->user, $this->other);
+
+        if ($result) {
+            $channel->output($this->user, sprintf(_('Unsubscribed  %s'), $this->other));
+        } else {
+            $channel->error($this->user, $result);
+        }
+    }
+}
+
 class SubscriptionsCommand extends Command
 {
     function execute($channel)
@@ -750,6 +778,7 @@ class HelpCommand extends Command
                            "d <nickname> <text> - direct message to user\n".
                            "get <nickname> - get last notice from user\n".
                            "whois <nickname> - get profile info on user\n".
+                           "lose <nickname> - force user to stop following you\n".
                            "fav <nickname> - add user's last notice as a 'fave'\n".
                            "fav #<notice_id> - add notice with the given id as a 'fave'\n".
                            "repeat #<notice_id> - repeat a notice with a given id\n".
index c2add7299e7330287303374944d912caa753dc09..fbc6174bbfab1b95a2d9573df2043e3688cf9a0f 100644 (file)
@@ -47,6 +47,17 @@ class CommandInterpreter
             } else {
                 return new LoginCommand($user);
             }
+         case 'lose':
+            if ($arg) {
+                list($other, $extra) = $this->split_arg($arg);
+                if ($extra) {
+                    return null;
+                } else {
+                    return new LoseCommand($user, $other);
+                }
+            } else {
+              return null;
+            }
          case 'subscribers':
             if ($arg) {
                 return null;
index d849055c213287b968da6b303ca6ec924815b2d3..b06b9615762072721ed31d8b30f08248a1b6d1af 100644 (file)
@@ -279,6 +279,7 @@ $default =
                                  'Geonames' => null,
                                  'Mapstraction' => null,
                                  'WikiHashtags' => null,
+                                 'RSSCloud' => null,
                                  'OpenID' => null),
               ),
         'admin' =>
index 7315fe2ad44d34c43c107af91da9bbaa6e6c595e..7786b5941e25ba770d3f11c029f360af5b322f50 100644 (file)
@@ -356,40 +356,47 @@ class HTMLOutputter extends XMLOutputter
 
             if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
             {
-                $path = common_config('javascript', 'path');
+                if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) {
 
-                if (empty($path)) {
-                    $path = common_config('site', 'path') . '/js/';
-                }
+                    $src = common_path($src) . '?version=' . STATUSNET_VERSION;
 
-                if ($path[strlen($path)-1] != '/') {
-                    $path .= '/';
-                }
+                }else{
 
-                if ($path[0] != '/') {
-                    $path = '/'.$path;
-                }
+                    $path = common_config('javascript', 'path');
 
-                $server = common_config('javascript', 'server');
+                    if (empty($path)) {
+                        $path = common_config('site', 'path') . '/js/';
+                    }
 
-                if (empty($server)) {
-                    $server = common_config('site', 'server');
-                }
+                    if ($path[strlen($path)-1] != '/') {
+                        $path .= '/';
+                    }
 
-                $ssl = common_config('javascript', 'ssl');
+                    if ($path[0] != '/') {
+                        $path = '/'.$path;
+                    }
+
+                    $server = common_config('javascript', 'server');
 
-                if (is_null($ssl)) { // null -> guess
-                    if (common_config('site', 'ssl') == 'always' &&
-                        !common_config('javascript', 'server')) {
-                        $ssl = true;
-                    } else {
-                        $ssl = false;
+                    if (empty($server)) {
+                        $server = common_config('site', 'server');
                     }
-                }
 
-                $protocol = ($ssl) ? 'https' : 'http';
+                    $ssl = common_config('javascript', 'ssl');
 
-                $src = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION;
+                    if (is_null($ssl)) { // null -> guess
+                        if (common_config('site', 'ssl') == 'always' &&
+                            !common_config('javascript', 'server')) {
+                            $ssl = true;
+                        } else {
+                            $ssl = false;
+                        }
+                    }
+
+                    $protocol = ($ssl) ? 'https' : 'http';
+
+                    $src = $protocol.'://'.$server.$path.$src . '?version=' . STATUSNET_VERSION;
+                }
             }
 
             $this->element('script', array('type' => $type,
index 6bc8e599b3022f7aa29d9c80045157989f627293..7b047945528ec4dffa331b09849b9f2db82663fd 100644 (file)
@@ -99,6 +99,10 @@ class ImageFile
 
         if ($info[2] !== IMAGETYPE_GIF &&
             $info[2] !== IMAGETYPE_JPEG &&
+            $info[2] !== IMAGETYPE_BMP &&
+            $info[2] !== IMAGETYPE_WBMP &&
+            $info[2] !== IMAGETYPE_XBM &&
+            $info[2] !== IMAGETYPE_XPM &&
             $info[2] !== IMAGETYPE_PNG) {
 
             @unlink($_FILES[$param]['tmp_name']);
@@ -146,6 +150,18 @@ class ImageFile
          case IMAGETYPE_PNG:
             $image_src = imagecreatefrompng($this->filepath);
             break;
+         case IMAGETYPE_BMP:
+            $image_src = imagecreatefrombmp($this->filepath);
+            break;
+         case IMAGETYPE_WBMP:
+            $image_src = imagecreatefromwbmp($this->filepath);
+            break;
+         case IMAGETYPE_XBM:
+            $image_src = imagecreatefromxbm($this->filepath);
+            break;
+         case IMAGETYPE_XPM:
+            $image_src = imagecreatefromxpm($this->filepath);
+            break;
          default:
             throw new Exception(_('Unknown file type'));
             return;
@@ -153,7 +169,7 @@ class ImageFile
 
         $image_dest = imagecreatetruecolor($size, $size);
 
-        if ($this->type == IMAGETYPE_GIF || $this->type == IMAGETYPE_PNG) {
+        if ($this->type == IMAGETYPE_GIF || $this->type == IMAGETYPE_PNG || $this->type == IMAGETYPE_BMP) {
 
             $transparent_idx = imagecolortransparent($image_src);
 
@@ -176,6 +192,24 @@ class ImageFile
 
         imagecopyresampled($image_dest, $image_src, 0, 0, $x, $y, $size, $size, $w, $h);
 
+        if($this->type == IMAGETYPE_BMP) {
+            //we don't want to save BMP... it's an inefficient, rare, antiquated format
+            //save png instead
+            $this->type = IMAGETYPE_PNG;
+        } else if($this->type == IMAGETYPE_WBMP) {
+            //we don't want to save WBMP... it's a rare format that we can't guarantee clients will support
+            //save png instead
+            $this->type = IMAGETYPE_PNG;
+        } else if($this->type == IMAGETYPE_XBM) {
+            //we don't want to save XBM... it's a rare format that we can't guarantee clients will support
+            //save png instead
+            $this->type = IMAGETYPE_PNG;
+        } else if($this->type == IMAGETYPE_XPM) {
+            //we don't want to save XPM... it's a rare format that we can't guarantee clients will support
+            //save png instead
+            $this->type = IMAGETYPE_PNG;
+        }
+
         $outname = Avatar::filename($this->id,
                                     image_type_to_extension($this->type),
                                     $size,
@@ -245,4 +279,101 @@ class ImageFile
 
         return $num;
     }
-}
\ No newline at end of file
+}
+
+//PHP doesn't (as of 2/24/2010) have an imagecreatefrombmp so conditionally define one
+if(!function_exists('imagecreatefrombmp')){
+    //taken shamelessly from http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214
+    function imagecreatefrombmp($p_sFile)
+    {
+        //    Load the image into a string
+        $file    =    fopen($p_sFile,"rb");
+        $read    =    fread($file,10);
+        while(!feof($file)&&($read<>""))
+            $read    .=    fread($file,1024);
+
+        $temp    =    unpack("H*",$read);
+        $hex    =    $temp[1];
+        $header    =    substr($hex,0,108);
+
+        //    Process the header
+        //    Structure: http://www.fastgraph.com/help/bmp_header_format.html
+        if (substr($header,0,4)=="424d")
+        {
+            //    Cut it in parts of 2 bytes
+            $header_parts    =    str_split($header,2);
+
+            //    Get the width        4 bytes
+            $width            =    hexdec($header_parts[19].$header_parts[18]);
+
+            //    Get the height        4 bytes
+            $height            =    hexdec($header_parts[23].$header_parts[22]);
+
+            //    Unset the header params
+            unset($header_parts);
+        }
+
+        //    Define starting X and Y
+        $x                =    0;
+        $y                =    1;
+
+        //    Create newimage
+        $image            =    imagecreatetruecolor($width,$height);
+
+        //    Grab the body from the image
+        $body            =    substr($hex,108);
+
+        //    Calculate if padding at the end-line is needed
+        //    Divided by two to keep overview.
+        //    1 byte = 2 HEX-chars
+        $body_size        =    (strlen($body)/2);
+        $header_size    =    ($width*$height);
+
+        //    Use end-line padding? Only when needed
+        $usePadding        =    ($body_size>($header_size*3)+4);
+
+        //    Using a for-loop with index-calculation instaid of str_split to avoid large memory consumption
+        //    Calculate the next DWORD-position in the body
+        for ($i=0;$i<$body_size;$i+=3)
+        {
+            //    Calculate line-ending and padding
+            if ($x>=$width)
+            {
+                //    If padding needed, ignore image-padding
+                //    Shift i to the ending of the current 32-bit-block
+                if ($usePadding)
+                    $i    +=    $width%4;
+
+                //    Reset horizontal position
+                $x    =    0;
+
+                //    Raise the height-position (bottom-up)
+                $y++;
+
+                //    Reached the image-height? Break the for-loop
+                if ($y>$height)
+                    break;
+            }
+
+            //    Calculation of the RGB-pixel (defined as BGR in image-data)
+            //    Define $i_pos as absolute position in the body
+            $i_pos    =    $i*2;
+            $r        =    hexdec($body[$i_pos+4].$body[$i_pos+5]);
+            $g        =    hexdec($body[$i_pos+2].$body[$i_pos+3]);
+            $b        =    hexdec($body[$i_pos].$body[$i_pos+1]);
+
+            //    Calculate and draw the pixel
+            $color    =    imagecolorallocate($image,$r,$g,$b);
+            imagesetpixel($image,$x,$height-$y,$color);
+
+            //    Raise the horizontal position
+            $x++;
+        }
+
+        //    Unset the body / free the memory
+        unset($body);
+
+        //    Return image-object
+        return $image;
+    }
+}
index d20837ba54a3dac70e5731a2eb1b705912beb8ac..7cfb2c9a0ff18c59039cfdae634c728ec9fc8282 100644 (file)
@@ -330,7 +330,7 @@ abstract class IoMaster
      * for per-queue and per-site records.
      *
      * @param string $key counter name
-     * @param array $owners list of owner keys like 'queue:jabber' or 'site:stat01'
+     * @param array $owners list of owner keys like 'queue:xmpp' or 'site:stat01'
      */
     public function stats($key, $owners=array())
     {
index 9fdc801100f46f58df9e9ab22c71529da55af6bd..87bd356aa2b0d7ea43c959513bda4e0001958884 100644 (file)
@@ -213,7 +213,9 @@ abstract class QueueManager extends IoManager
     {
         if (isset($this->handlers[$queue])) {
             $class = $this->handlers[$queue];
-            if (class_exists($class)) {
+            if(is_object($class)) {
+                return $class;
+            } else if (class_exists($class)) {
                 return new $class();
             } else {
                 $this->_log(LOG_ERR, "Nonexistent handler class '$class' for queue '$queue'");
@@ -286,7 +288,7 @@ abstract class QueueManager extends IoManager
      * Only registered transports will be reliably picked up!
      *
      * @param string $transport
-     * @param string $class
+     * @param string $class class name or object instance
      * @param string $group
      */
     public function connect($transport, $class, $group='main')
index 1c240c475d40c7f71fd428de44eec07499dc3baa..e2ce0667eb19f78e3c2e9f5aed9fb0fdcc76df47 100644 (file)
@@ -42,4 +42,47 @@ function subs_unsubscribe_to($user, $other)
     } catch (Exception $e) {
         return $e->getMessage();
     }
-}
\ No newline at end of file
+}
+
+function subs_unsubscribe_from($user, $other){
+   $local = User::staticGet("nickname",$other);
+   if($local){
+     return subs_unsubscribe_to($local,$user);
+   } else {
+    try {
+        $remote = Profile::staticGet("nickname",$other);
+        if(is_string($remote)){
+          return $remote;
+        }
+        if (Event::handle('StartUnsubscribe', array($remote,$user))) {
+
+            $sub = DB_DataObject::factory('subscription');
+
+            $sub->subscriber = $remote->id;
+            $sub->subscribed = $user->id;
+
+            $sub->find(true);
+
+            // note we checked for existence above
+
+            if (!$sub->delete())
+              return _('Couldn\'t delete subscription.');
+
+            $cache = common_memcache();
+
+            if ($cache) {
+                $cache->delete(common_cache_key('user:notices_with_friends:' . $remote->id));
+            }
+
+
+            $user->blowSubscribersCount();
+            $remote->blowSubscribersCount();
+
+            Event::handle('EndUnsubscribe', array($remote, $user));
+        }
+    } catch (Exception $e) {
+        return $e->getMessage();
+    }
+   }
+}
+
index 8381bc63c0da254706de3129750fc83cbab5b2f6..1231f4c8d1cd3dd9ef39973c2f4c65e28575a189 100644 (file)
@@ -731,20 +731,13 @@ function common_linkify($url) {
     }
 
     if (!empty($f)) {
-        if ($f->isEnclosure()) {
+        if ($f->getEnclosure()) {
             $is_attachment = true;
             $attachment_id = $f->id;
-        } else {
-            $foe = File_oembed::staticGet('file_id', $f->id);
-            if (!empty($foe)) {
-                // if it has OEmbed info, it's an attachment, too
-                $is_attachment = true;
-                $attachment_id = $f->id;
-
-                $thumb = File_thumbnail::staticGet('file_id', $f->id);
-                if (!empty($thumb)) {
-                    $has_thumb = true;
-                }
+
+            $thumb = File_thumbnail::staticGet('file_id', $f->id);
+            if (!empty($thumb)) {
+                $has_thumb = true;
             }
         }
     }
index cf0cc849b24d3455e68fdcef7b94ef33b44c13d5..f5b771140058895c800870b332a04467dd769c77 100644 (file)
@@ -14,12 +14,12 @@ msgid ""
 msgstr ""
 "Project-Id-Version: StatusNet\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:50:48+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:55:22+0000\n"
 "Language-Team: French\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
 "X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
 "X-Language-Code: fr\n"
 "X-Message-Group: out-statusnet\n"
@@ -3984,17 +3984,17 @@ msgstr "Impossible d’enregistrer l’abonnement."
 
 #: actions/subscribe.php:77
 msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Cette action n'accepte que les requêtes de type POST."
 
 #: actions/subscribe.php:107
-#, fuzzy
 msgid "No such profile."
-msgstr "Fichier non trouvé."
+msgstr "Profil non-trouvé."
 
 #: actions/subscribe.php:117
-#, fuzzy
 msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Vous n’êtes pas abonné(e) à ce profil."
+msgstr ""
+"Vous ne pouvez pas vous abonner  à un profil OMB 0.1 distant par cette "
+"action."
 
 #: actions/subscribe.php:145
 msgid "Subscribed"
@@ -4816,15 +4816,15 @@ msgstr "Avant"
 
 #: lib/activity.php:382
 msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Impossible de gérer le contenu distant pour le moment."
 
 #: lib/activity.php:410
 msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Impossible de gérer le contenu XML embarqué pour le moment."
 
 #: lib/activity.php:414
 msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Impossible de gérer le contenu en Base64 embarqué pour le moment."
 
 #: lib/adminpanelaction.php:96
 msgid "You cannot make changes to this site."
@@ -5214,7 +5214,6 @@ msgstr[0] "Vous êtes membre de ce groupe :"
 msgstr[1] "Vous êtes membre de ces groupes :"
 
 #: lib/command.php:769
-#, fuzzy
 msgid ""
 "Commands:\n"
 "on - turn on notifications\n"
@@ -5267,6 +5266,7 @@ msgstr ""
 "d <nickname> <text> - message direct à l’utilisateur\n"
 "get <nickname> - obtenir le dernier avis de l’utilisateur\n"
 "whois <nickname> - obtenir le profil de l’utilisateur\n"
+"lose <nickname> - forcer un utilisateur à arrêter de vous suivre\n"
 "fav <nickname> - ajouter de dernier avis de l’utilisateur comme favori\n"
 "fav #<notice_id> - ajouter l’avis correspondant à l’identifiant comme "
 "favori\n"
@@ -5500,23 +5500,23 @@ msgstr "Erreur système lors du transfert du fichier."
 msgid "Not an image or corrupt file."
 msgstr "Ceci n’est pas une image, ou c’est un fichier corrompu."
 
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
 msgid "Unsupported image file format."
 msgstr "Format de fichier d’image non supporté."
 
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
 msgid "Lost our file."
 msgstr "Fichier perdu."
 
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
 msgid "Unknown file type"
 msgstr "Type de fichier inconnu"
 
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
 msgid "MB"
 msgstr "Mo"
 
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
 msgid "kB"
 msgstr "Ko"
 
index 14efaf620dfba574d5b950464e97edaf57c66838..8d9e5506965d6dc8cdc3b55521d9c7b4b9214624 100644 (file)
@@ -9,12 +9,12 @@ msgid ""
 msgstr ""
 "Project-Id-Version: StatusNet\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:18+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:05+0000\n"
 "Language-Team: Macedonian\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
 "X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
 "X-Language-Code: mk\n"
 "X-Message-Group: out-statusnet\n"
@@ -3957,17 +3957,16 @@ msgstr "Не можев да ја зачувам претплатата."
 
 #: actions/subscribe.php:77
 msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Ова дејство прифаќа само POST-барања"
 
 #: actions/subscribe.php:107
-#, fuzzy
 msgid "No such profile."
-msgstr "Ð\9dема Ñ\82аква Ð¿Ð¾Ð´Ð°Ñ\82оÑ\82ека."
+msgstr "Ð\9dема Ñ\82аков Ð¿Ñ\80оÑ\84ил."
 
 #: actions/subscribe.php:117
-#, fuzzy
 msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Не сте претплатени на тој профил."
+msgstr ""
+"Не можете да се претплатите на OMB 0.1 оддалечен профил со ова дејство."
 
 #: actions/subscribe.php:145
 msgid "Subscribed"
@@ -4786,15 +4785,15 @@ msgstr "Пред"
 
 #: lib/activity.php:382
 msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Сè уште не е поддржана обработката на оддалечена содржина."
 
 #: lib/activity.php:410
 msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Сè уште не е поддржана обработката на XML содржина."
 
 #: lib/activity.php:414
 msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Сè уште не е достапна обработката на вметната Base64 содржина."
 
 #: lib/adminpanelaction.php:96
 msgid "You cannot make changes to this site."
@@ -5143,9 +5142,9 @@ msgid "This link is useable only once, and is good for only 2 minutes: %s"
 msgstr "Оваа врска може да се употреби само еднаш, и трае само 2 минути: %s"
 
 #: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
 msgid "Unsubscribed  %s"
-msgstr "Ð\9fÑ\80еÑ\82плаÑ\82аÑ\82а Ð½Ð° %s Ðµ Ð¾Ñ\82кажана"
+msgstr "Ð\9eÑ\82кажана Ð¿Ñ\80еÑ\82плаÑ\82а Ð½Ð°  %s"
 
 #: lib/command.php:709
 msgid "You are not subscribed to anyone."
@@ -5178,7 +5177,6 @@ msgstr[0] "Не ни го испративте тој профил."
 msgstr[1] "Не ни го испративте тој профил."
 
 #: lib/command.php:769
-#, fuzzy
 msgid ""
 "Commands:\n"
 "on - turn on notifications\n"
@@ -5459,23 +5457,23 @@ msgstr "Системска грешка при подигањето на под
 msgid "Not an image or corrupt file."
 msgstr "Не е слика или податотеката е пореметена."
 
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
 msgid "Unsupported image file format."
 msgstr "Неподдржан фомрат на слики."
 
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
 msgid "Lost our file."
 msgstr "Податотеката е изгубена."
 
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
 msgid "Unknown file type"
 msgstr "Непознат тип на податотека"
 
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
 msgid "MB"
 msgstr "МБ"
 
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
 msgid "kB"
 msgstr "кб"
 
index 1cd71ad86814eb5e9be4d0d5e39abe4d76c1fd94..e01fb6d3f04199a698fe4f30a87ce2899ddd5875 100644 (file)
@@ -10,12 +10,12 @@ msgid ""
 msgstr ""
 "Project-Id-Version: StatusNet\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:28+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:20+0000\n"
 "Language-Team: Dutch\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
 "X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
 "X-Language-Code: nl\n"
 "X-Message-Group: out-statusnet\n"
@@ -3981,17 +3981,17 @@ msgstr "Het was niet mogelijk het abonnement op te slaan."
 
 #: actions/subscribe.php:77
 msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Deze handeling accepteert alleen POST-verzoeken."
 
 #: actions/subscribe.php:107
-#, fuzzy
 msgid "No such profile."
-msgstr "Het bestand bestaat niet."
+msgstr "Het profiel bestaat niet."
 
 #: actions/subscribe.php:117
-#, fuzzy
 msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "U bent niet geabonneerd op dat profiel."
+msgstr ""
+"U kunt niet abonneren op een OMB 1.0 profiel van een andere omgeving via "
+"deze handeling."
 
 #: actions/subscribe.php:145
 msgid "Subscribed"
@@ -4820,15 +4820,15 @@ msgstr "Eerder"
 
 #: lib/activity.php:382
 msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Het is nog niet mogelijk inhoud uit andere omgevingen te verwerken."
 
 #: lib/activity.php:410
 msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Het is nog niet mogelijk ingebedde XML-inhoud te verwerken"
 
 #: lib/activity.php:414
 msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Het is nog niet mogelijk ingebedde Base64-inhoud te verwerken"
 
 #: lib/adminpanelaction.php:96
 msgid "You cannot make changes to this site."
@@ -5182,9 +5182,9 @@ msgstr ""
 "geldig: %s"
 
 #: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
 msgid "Unsubscribed  %s"
-msgstr "Uw abonnement op %s is opgezegd"
+msgstr "Het abonnement van %s is opgeheven"
 
 #: lib/command.php:709
 msgid "You are not subscribed to anyone."
@@ -5217,7 +5217,6 @@ msgstr[0] "U bent lid van deze groep:"
 msgstr[1] "U bent lid van deze groepen:"
 
 #: lib/command.php:769
-#, fuzzy
 msgid ""
 "Commands:\n"
 "on - turn on notifications\n"
@@ -5270,6 +5269,7 @@ msgstr ""
 "d <gebruiker> <tekst> - direct bericht aan gebruiker\n"
 "get <gebruiker> - laatste mededeling van gebruiker opvragen\n"
 "whois <gebruiker> - profielinformatie van gebruiker opvragen\n"
+"lose <gebruiker> - zorgt ervoor dat de gebruiker u niet meer volgt\n"
 "fav <gebruiker> - laatste mededeling van gebruiker op favorietenlijst "
 "zetten\n"
 "fav #<mededeling-ID> - mededelingen met aangegeven ID op favorietenlijst "
@@ -5501,23 +5501,23 @@ msgstr "Er is een systeemfout opgetreden tijdens het uploaden van het bestand."
 msgid "Not an image or corrupt file."
 msgstr "Het bestand is geen afbeelding of het bestand is beschadigd."
 
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
 msgid "Unsupported image file format."
 msgstr "Niet ondersteund beeldbestandsformaat."
 
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
 msgid "Lost our file."
 msgstr "Het bestand is zoekgeraakt."
 
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
 msgid "Unknown file type"
 msgstr "Onbekend bestandstype"
 
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
 msgid "MB"
 msgstr "MB"
 
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
 msgid "kB"
 msgstr "kB"
 
index 79b37a5e4c9a637a16253f1345bf57dd23177efb..5f4b051cb90620cf13f66cf505f4ed4d37026c6f 100644 (file)
@@ -10,8 +10,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: StatusNet\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:31+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:23+0000\n"
 "Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
 "Language-Team: Polish <pl@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -19,7 +19,7 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
 "|| n%100>=20) ? 1 : 2);\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
 "X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
 "X-Language-Code: pl\n"
 "X-Message-Group: out-statusnet\n"
@@ -1100,7 +1100,7 @@ msgstr "Zmień kolory"
 
 #: actions/designadminpanel.php:510 lib/designsettings.php:191
 msgid "Content"
-msgstr "Zawartość"
+msgstr "Treść"
 
 #: actions/designadminpanel.php:523 lib/designsettings.php:204
 msgid "Sidebar"
@@ -2160,7 +2160,7 @@ msgstr "Nie można wysłać wiadomości do tego użytkownika."
 #: actions/newmessage.php:144 actions/newnotice.php:136 lib/command.php:342
 #: lib/command.php:475
 msgid "No content!"
-msgstr "Brak zawartości."
+msgstr "Brak treści."
 
 #: actions/newmessage.php:158
 msgid "No recipient specified."
@@ -2198,7 +2198,7 @@ msgid ""
 "Search for notices on %%site.name%% by their contents. Separate search terms "
 "by spaces; they must be 3 characters or more."
 msgstr ""
-"Wyszukaj wpisy na %%site.name%% według ich zawartości. Oddziel wyszukiwane "
+"Wyszukaj wpisy na %%site.name%% według ich treści. Oddziel wyszukiwane "
 "terminy spacjami. Terminy muszą mieć trzy znaki lub więcej."
 
 #: actions/noticesearch.php:78
@@ -3925,17 +3925,17 @@ msgstr "Nie można zapisać subskrypcji."
 
 #: actions/subscribe.php:77
 msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Ta czynność przyjmuje tylko żądania POST."
 
 #: actions/subscribe.php:107
-#, fuzzy
 msgid "No such profile."
-msgstr "Nie ma takiego pliku."
+msgstr "Nie ma takiego profilu."
 
 #: actions/subscribe.php:117
-#, fuzzy
 msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Nie jesteś subskrybowany do tego profilu."
+msgstr ""
+"Nie można subskrybować zdalnego profilu profilu OMB 0.1 za pomocą tej "
+"czynności."
 
 #: actions/subscribe.php:145
 msgid "Subscribed"
@@ -4754,15 +4754,15 @@ msgstr "Wcześniej"
 
 #: lib/activity.php:382
 msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Nie można jeszcze obsługiwać zdalnej treści."
 
 #: lib/activity.php:410
 msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Nie można jeszcze obsługiwać zagnieżdżonej treści XML."
 
 #: lib/activity.php:414
 msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Nie można jeszcze obsługiwać zagnieżdżonej treści Base64."
 
 #: lib/adminpanelaction.php:96
 msgid "You cannot make changes to this site."
@@ -5112,7 +5112,7 @@ msgstr ""
 "minuty: %s."
 
 #: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
 msgid "Unsubscribed  %s"
 msgstr "Usunięto subskrypcję użytkownika %s"
 
@@ -5150,7 +5150,6 @@ msgstr[1] "Jesteś członkiem tych grup:"
 msgstr[2] "Jesteś członkiem tych grup:"
 
 #: lib/command.php:769
-#, fuzzy
 msgid ""
 "Commands:\n"
 "on - turn on notifications\n"
@@ -5195,14 +5194,15 @@ msgstr ""
 "on - włącza powiadomienia\n"
 "off - wyłącza powiadomienia\n"
 "help - wyświetla tę pomoc\n"
-"follow <pseudonim> - włącza obserwowanie użytkownika\n"
+"follow <pseudonim> - subskrybuje użytkownika\n"
 "groups - wyświetla listę grup, do których dołączyłeś\n"
 "subscriptions - wyświetla listę obserwowanych osób\n"
 "subscribers - wyświetla listę osób, które cię obserwują\n"
-"leave <pseudonim> - rezygnuje z obserwowania użytkownika\n"
+"leave <pseudonim> - usuwa subskrypcję użytkownika\n"
 "d <pseudonim> <tekst> - bezpośrednia wiadomość do użytkownika\n"
 "get <pseudonim> - zwraca ostatni wpis użytkownika\n"
 "whois <pseudonim> - zwraca informacje o profilu użytkownika\n"
+"lose <pseudonim> - wymusza użytkownika do zatrzymania obserwowania cię\n"
 "fav <pseudonim> - dodaje ostatni wpis użytkownika jako \"ulubiony\"\n"
 "fav #<identyfikator_wpisu> - dodaje wpis z podanym identyfikatorem jako "
 "\"ulubiony\"\n"
@@ -5433,23 +5433,23 @@ msgstr "Błąd systemu podczas wysyłania pliku."
 msgid "Not an image or corrupt file."
 msgstr "To nie jest obraz lub lub plik jest uszkodzony."
 
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
 msgid "Unsupported image file format."
 msgstr "Nieobsługiwany format pliku obrazu."
 
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
 msgid "Lost our file."
 msgstr "Utracono plik."
 
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
 msgid "Unknown file type"
 msgstr "Nieznany typ pliku"
 
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
 msgid "MB"
 msgstr "MB"
 
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
 msgid "kB"
 msgstr "KB"
 
index d4df1a654898d1831d01362b6f618619c47aa8c6..a23f7c2f30a9a4977b0034234f6f2a9a2a695339 100644 (file)
@@ -12,12 +12,12 @@ msgid ""
 msgstr ""
 "Project-Id-Version: StatusNet\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:41+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:32+0000\n"
 "Language-Team: Russian\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
 "X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
 "X-Language-Code: ru\n"
 "X-Message-Group: out-statusnet\n"
@@ -3948,17 +3948,17 @@ msgstr "Не удаётся сохранить подписку."
 
 #: actions/subscribe.php:77
 msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Это действие принимает только POST-запросы."
 
 #: actions/subscribe.php:107
-#, fuzzy
 msgid "No such profile."
-msgstr "Нет такого файла."
+msgstr "Нет такого профиля."
 
 #: actions/subscribe.php:117
-#, fuzzy
 msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Вы не подписаны на этот профиль."
+msgstr ""
+"Вы не можете подписаться на удалённый профиль OMB 0.1 с помощью этого "
+"действия."
 
 #: actions/subscribe.php:145
 msgid "Subscribed"
@@ -4774,15 +4774,15 @@ msgstr "Туда"
 
 #: lib/activity.php:382
 msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Пока ещё нельзя обрабатывать удалённое содержимое."
 
 #: lib/activity.php:410
 msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Пока ещё нельзя обрабатывать встроенный XML."
 
 #: lib/activity.php:414
 msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Пока ещё нельзя обрабатывать встроенное содержание Base64."
 
 #: lib/adminpanelaction.php:96
 msgid "You cannot make changes to this site."
@@ -5130,9 +5130,9 @@ msgid "This link is useable only once, and is good for only 2 minutes: %s"
 msgstr "Эта ссылка действительна только один раз в течение 2 минут: %s"
 
 #: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
 msgid "Unsubscribed  %s"
-msgstr "Отписано от %s"
+msgstr "Отписано %s"
 
 #: lib/command.php:709
 msgid "You are not subscribed to anyone."
@@ -5168,7 +5168,6 @@ msgstr[1] "Вы являетесь участником следующих гр
 msgstr[2] "Вы являетесь участником следующих групп:"
 
 #: lib/command.php:769
-#, fuzzy
 msgid ""
 "Commands:\n"
 "on - turn on notifications\n"
@@ -5221,6 +5220,7 @@ msgstr ""
 "d <nickname> <text> — прямое сообщение пользователю\n"
 "get <nickname> — получить последнюю запись от пользователя\n"
 "whois <nickname> — получить информацию из профиля пользователя\n"
+"lose <nickname> — отменить подписку пользователя на вас\n"
 "fav <nickname> — добавить последнюю запись пользователя в число любимых\n"
 "fav #<notice_id> — добавить запись с заданным id в число любимых\n"
 "repeat #<notice_id> — повторить уведомление с заданным id\n"
@@ -5449,23 +5449,23 @@ msgstr "Системная ошибка при загрузке файла."
 msgid "Not an image or corrupt file."
 msgstr "Не является изображением или повреждённый файл."
 
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
 msgid "Unsupported image file format."
 msgstr "Неподдерживаемый формат файла изображения."
 
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
 msgid "Lost our file."
 msgstr "Потерян файл."
 
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
 msgid "Unknown file type"
 msgstr "Неподдерживаемый тип файла"
 
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
 msgid "MB"
 msgstr "МБ"
 
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
 msgid "kB"
 msgstr "КБ"
 
index cf44e2d3c960111c3679c3283fb8a86b6278abe0..483c7711b447dc4d3573d883ac433a3cd0e1ddd6 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -5095,23 +5095,23 @@ msgstr ""
 msgid "Not an image or corrupt file."
 msgstr ""
 
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
 msgid "Unsupported image file format."
 msgstr ""
 
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
 msgid "Lost our file."
 msgstr ""
 
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
 msgid "Unknown file type"
 msgstr ""
 
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
 msgid "MB"
 msgstr ""
 
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
 msgid "kB"
 msgstr ""
 
index c261c310da684250d26a7532dcb4688095020392..cf1a2bf622c14baab91a7f4d3c802bd679696d09 100644 (file)
@@ -10,12 +10,12 @@ msgid ""
 msgstr ""
 "Project-Id-Version: StatusNet\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-02-24 23:49+0000\n"
-"PO-Revision-Date: 2010-02-24 23:51:53+0000\n"
+"POT-Creation-Date: 2010-02-25 11:54+0000\n"
+"PO-Revision-Date: 2010-02-25 11:56:43+0000\n"
 "Language-Team: Ukrainian\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: MediaWiki 1.17alpha (r62925); Translate extension (2010-01-16)\n"
+"X-Generator: MediaWiki 1.17alpha (r62948); Translate extension (2010-01-16)\n"
 "X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
 "X-Language-Code: uk\n"
 "X-Message-Group: out-statusnet\n"
@@ -3934,17 +3934,15 @@ msgstr "Не вдалося зберегти підписку."
 
 #: actions/subscribe.php:77
 msgid "This action only accepts POST requests."
-msgstr ""
+msgstr "Ця дія приймає лише запити POST."
 
 #: actions/subscribe.php:107
-#, fuzzy
 msgid "No such profile."
-msgstr "Такого Ñ\84айлÑ\83 Ð½ÐµÐ¼Ð°Ñ\94."
+msgstr "Ð\9dемаÑ\94 Ñ\82акого Ð¿Ñ\80оÑ\84Ñ\96лÑ\8e."
 
 #: actions/subscribe.php:117
-#, fuzzy
 msgid "You cannot subscribe to an OMB 0.1 remote profile with this action."
-msgstr "Ð\92и Ð½Ðµ Ð¿Ñ\96дпиÑ\81анÑ\96 Ð´Ð¾ Ñ\86Ñ\8cого Ð¿Ñ\80оÑ\84Ñ\96лÑ\8e."
+msgstr "ЦÑ\96Ñ\94Ñ\8e Ð´Ñ\96Ñ\94Ñ\8e Ð\92и Ð½Ðµ Ð·Ð¼Ð¾Ð¶ÐµÑ\82е Ð¿Ñ\96дпиÑ\81аÑ\82иÑ\81Ñ\8f Ð´Ð¾ Ð²Ñ\96ддаленого Ð¿Ñ\80оÑ\84Ñ\96лÑ\8e OMB 0.1."
 
 #: actions/subscribe.php:145
 msgid "Subscribed"
@@ -4757,15 +4755,15 @@ msgstr "Назад"
 
 #: lib/activity.php:382
 msgid "Can't handle remote content yet."
-msgstr ""
+msgstr "Поки що не можу обробити віддалений контент."
 
 #: lib/activity.php:410
 msgid "Can't handle embedded XML content yet."
-msgstr ""
+msgstr "Поки що не можу обробити вбудований XML контент."
 
 #: lib/activity.php:414
 msgid "Can't handle embedded Base64 content yet."
-msgstr ""
+msgstr "Поки що не можу обробити вбудований контент Base64."
 
 #: lib/adminpanelaction.php:96
 msgid "You cannot make changes to this site."
@@ -5113,9 +5111,9 @@ msgstr ""
 "Це посилання можна використати лише раз, воно дійсне протягом 2 хвилин: %s"
 
 #: lib/command.php:692
-#, fuzzy, php-format
+#, php-format
 msgid "Unsubscribed  %s"
-msgstr "Відписано від %s"
+msgstr "Відписано %s"
 
 #: lib/command.php:709
 msgid "You are not subscribed to anyone."
@@ -5151,7 +5149,6 @@ msgstr[1] "Ви є учасником таких груп:"
 msgstr[2] "Ви є учасником таких груп:"
 
 #: lib/command.php:769
-#, fuzzy
 msgid ""
 "Commands:\n"
 "on - turn on notifications\n"
@@ -5429,23 +5426,23 @@ msgstr "Система відповіла помилкою при заванта
 msgid "Not an image or corrupt file."
 msgstr "Це не зображення, або файл зіпсовано."
 
-#: lib/imagefile.php:105
+#: lib/imagefile.php:109
 msgid "Unsupported image file format."
 msgstr "Формат зображення не підтримується."
 
-#: lib/imagefile.php:118
+#: lib/imagefile.php:122
 msgid "Lost our file."
 msgstr "Файл втрачено."
 
-#: lib/imagefile.php:150 lib/imagefile.php:197
+#: lib/imagefile.php:166 lib/imagefile.php:231
 msgid "Unknown file type"
 msgstr "Тип файлу не підтримується"
 
-#: lib/imagefile.php:217
+#: lib/imagefile.php:251
 msgid "MB"
 msgstr "Мб"
 
-#: lib/imagefile.php:219
+#: lib/imagefile.php:253
 msgid "kB"
 msgstr "кб"
 
diff --git a/plugins/Autocomplete/jquery-autocomplete/indicator.gif b/plugins/Autocomplete/jquery-autocomplete/indicator.gif
new file mode 100644 (file)
index 0000000..d0bce15
Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/indicator.gif differ
index 300d1e9a2488e7430becd87e7c5f0a95cafae092..29cb3004bf95df1ecb8543002b273aaca258e4b7 100644 (file)
@@ -68,7 +68,7 @@ class CometPlugin extends RealtimePlugin
         $ours = array('jquery.comet.js', 'cometupdate.js');
 
         foreach ($ours as $script) {
-            $scripts[] = common_path('plugins/Comet/'.$script);
+            $scripts[] = 'plugins/Comet/'.$script;
         }
 
         return $scripts;
index 4266b886d9cae1c9e9162e692de4fe5b9004ba13..78c9054e14818c1444e4d39e0173b2424b03a5e3 100644 (file)
@@ -181,7 +181,7 @@ class FacebookPlugin extends Plugin
         if ($this->reqFbScripts($action)) {
 
             $apikey      = common_config('facebook', 'apikey');
-            $plugin_path = common_path('plugins/Facebook');
+            $plugin_path = 'plugins/Facebook';
 
             $login_url  = common_local_url('FBConnectAuth');
             $logout_url = common_local_url('logout');
index 8437a705a7b7858ce5f4ecc416843ddd15182da2..f65b97c865587d10b675be04b558344b8fa3a936 100644 (file)
@@ -89,7 +89,7 @@ class FacebookAction extends Action
 
     function showScripts()
     {
-        $this->script(common_path('plugins/Facebook/facebookapp.js'));
+        $this->script('plugins/Facebook/facebookapp.js');
     }
 
     /**
index 89a775a16adbf0ff20427994ed1338e444a7a6aa..d1e920b009111d42f40f565bda2413beadc452d1 100644 (file)
@@ -86,7 +86,7 @@ class ImapPlugin extends Plugin
         }
     }
 
-    function onStartIoManagerClasses(&$classes)
+    function onStartQueueDaemonIoManagers(&$classes)
     {
         $classes[] = new ImapManager($this);
     }
index eb3a05117a4c72e2440190fce1dd8f90c7ffa87d..1b5dc92e3f12c6c48fd60c9b600573cdab858b42 100644 (file)
@@ -96,8 +96,11 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
         }
     }
 
-    function autoRegister($username)
+    function autoRegister($username, $nickname)
     {
+        if(is_null($nickname)){
+            $nickname = $username;
+        }
         $entry = $this->ldap_get_user($username,$this->attributes);
         if($entry){
             $registration_data = array();
@@ -107,6 +110,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
             if(isset($registration_data['email']) && !empty($registration_data['email'])){
                 $registration_data['email_confirmed']=true;
             }
+            $registration_data['nickname'] = $nickname;
             //set the database saved password to a random string.
             $registration_data['password']=common_good_rand(16);
             return User::register($registration_data);
@@ -153,6 +157,22 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
 
         return false;
     }
+
+    function suggestNicknameForUsername($username)
+    {
+        $entry = $this->ldap_get_user($username, $this->attributes);
+        if(!$entry){
+            //this really shouldn't happen
+            return $username;
+        }else{
+            $nickname = $entry->getValue($this->attributes['nickname'],'single');
+            if($nickname){
+                return $nickname;
+            }else{
+                return $username;
+            }
+        }
+    }
     
     //---utility functions---//
     function ldap_get_config(){
@@ -179,8 +199,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
         $ldap->setErrorHandling(PEAR_ERROR_RETURN);
         $err=$ldap->bind();
         if (Net_LDAP2::isError($err)) {
-            common_log(LOG_WARNING, 'Could not connect to LDAP server: '.$err->getMessage());
-            return false;
+            throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
         }
         if($config == null) $this->default_ldap=$ldap;
 
index 0460fb6396254f698b3b9bbfb26b54c1fd9f2f15..c188f2dbc1835b0acdab886bf1f56b4d3147c0bb 100644 (file)
@@ -9,7 +9,10 @@ to the bottom of your config.php
 
 Settings
 ========
-provider_name*: a unique name for this authentication provider.
+provider_name*: This is a identifier designated to the connection.
+    It's how StatusNet will refer to the authentication source.
+    For the most part, any name can be used, so long as each authentication source has a different identifier.
+    In most cases there will be only one authentication source used.
 authoritative (false): Set to true if LDAP's responses are authoritative
     (if authorative and LDAP fails, no other password checking will be done).
 autoregistration (false): Set to true if users should be automatically created
index 7f48ce5e1b0fd8b35578200fd49adb5ae4a4c24a..19aff42b8bb57a8a4e4c17677d6bc508ec3d3256 100644 (file)
@@ -167,7 +167,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
         $ldap->setErrorHandling(PEAR_ERROR_RETURN);
         $err=$ldap->bind();
         if (Net_LDAP2::isError($err)) {
-            common_log(LOG_WARNING, 'Could not connect to LDAP server: '.$err->getMessage());
+            throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
             return false;
         }
         if($config == null) $this->default_ldap=$ldap;
@@ -185,6 +185,9 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
         if($ldap==null) {
             $ldap = $this->ldap_get_connection();
         }
+        if(! $ldap) {
+            throw new Exception("Could not connect to LDAP");
+        }
         $filter = Net_LDAP2_Filter::create($this->attributes['username'], 'equals',  $username);
         $options = array(
             'attributes' => $attributes
index 44239d8e06faca03558284ddae6a9cce3edd2815..3a6d8d25e005eaefdfc94e1ddae6f1f09434d765 100644 (file)
@@ -11,7 +11,10 @@ You *cannot* use this plugin without the LDAP Authentication plugin
 
 Settings
 ========
-provider_name*: name of the LDAP authentication provider that this plugin works with.
+provider_name*: This is a identifier designated to the connection.
+    It's how StatusNet will refer to the authentication source.
+    For the most part, any name can be used, so long as each authentication source has a different identifier.
+    In most cases there will be only one authentication source used.
 authoritative (false): should this plugin be authoritative for
     authorization?
 uniqueMember_attribute ('uniqueMember')*: the attribute of a group
index fe1883ded484082b4133de9e10b97da64b5ca92c..69def60641d778decdf5e3ba8bf7e3cbed2633f9 100644 (file)
@@ -86,7 +86,11 @@ class MinifyPlugin extends Plugin
         $url = parse_url($src);
         if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
         {
-            $src = $this->minifyUrl($src);
+            if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) {
+                $src = $this->minifyUrl($src);
+            } else {
+                $src = $this->minifyUrl('js/'.$src);
+            }
         }
     }
 
index 720dedd0a0e67733349288b032605b7ca2e5185a..02282f2f67e195a40221e03eecfa78b6fba1d02e 100644 (file)
@@ -284,12 +284,12 @@ class OStatusPlugin extends Plugin
     }
 
     function onEndShowStatusNetStyles($action) {
-        $action->cssLink(common_path('plugins/OStatus/theme/base/css/ostatus.css'));
+        $action->cssLink('plugins/OStatus/theme/base/css/ostatus.css');
         return true;
     }
 
     function onEndShowStatusNetScripts($action) {
-        $action->script(common_path('plugins/OStatus/js/ostatus.js'));
+        $action->script('plugins/OStatus/js/ostatus.js');
         return true;
     }
 
index 248afe3fa88e92e32c2782c5c907b45055345530..6b35ec3e142f2f1503f7df6476e94691fb1d1d2f 100644 (file)
@@ -235,9 +235,14 @@ class OpenIDPlugin extends Plugin
         switch ($name)
         {
          case 'register':
-            $instr = '(Have an [OpenID](http://openid.net/)? ' .
-              'Try our [OpenID registration]'.
-              '(%%action.openidlogin%%)!)';
+            if (common_logged_in()) {
+                $instr = '(Have an [OpenID](http://openid.net/)? ' .
+                  '[Add an OpenID to your account](%%action.openidsettings%%)!';
+            } else {
+                $instr = '(Have an [OpenID](http://openid.net/)? ' .
+                  'Try our [OpenID registration]'.
+                  '(%%action.openidlogin%%)!)';
+            }
             break;
          case 'login':
             $instr = '(Have an [OpenID](http://openid.net/)? ' .
index ba87b266a03b2588cb62988531838dce483693c0..8af71af747246419595971f272d756128673d795 100644 (file)
@@ -77,9 +77,9 @@ class OrbitedPlugin extends RealtimePlugin
         $root = 'http://'.$server.(($port == 80) ? '':':'.$port);
 
         $scripts[] = $root.'/static/Orbited.js';
-        $scripts[] = common_path('plugins/Orbited/orbitedextra.js');
+        $scripts[] = 'plugins/Orbited/orbitedextra.js';
         $scripts[] = $root.'/static/protocols/stomp/stomp.js';
-        $scripts[] = common_path('plugins/Orbited/orbitedupdater.js');
+        $scripts[] = 'plugins/Orbited/orbitedupdater.js';
 
         return $scripts;
     }
diff --git a/plugins/README-plugins b/plugins/README-plugins
new file mode 100644 (file)
index 0000000..cdce7eb
--- /dev/null
@@ -0,0 +1,21 @@
+Several example plugins are included in the plugins/ directory. You
+can enable a plugin with the following line in config.php:
+
+    addPlugin('Example', array('param1' => 'value1',
+                               'param2' => 'value2'));
+
+This will look for and load files named 'ExamplePlugin.php' or
+'Example/ExamplePlugin.php' either in the plugins/ directory (for
+plugins that ship with StatusNet) or in the local/ directory (for
+plugins you write yourself or that you get from somewhere else) or
+local/plugins/.
+
+Plugins are documented in their own directories.
+
+
+Additional information on using and developing plugins can be found
+on the StatusNet wiki:
+
+http://status.net/wiki/Plugins
+http://status.net/wiki/Plugin_development
+
index 2b3cb35f1d370dcc8b3b6c5421b3129956bcd032..b559d80c605a540aa333299fb3e25deb998a0f35 100644 (file)
@@ -117,7 +117,7 @@ class RealtimePlugin extends Plugin
 
     function onEndShowStatusNetStyles($action)
     {
-        $action->cssLink(common_path('plugins/Realtime/realtimeupdate.css'),
+        $action->cssLink('plugins/Realtime/realtimeupdate.css',
                          null, 'screen, projection, tv');
         return true;
     }
@@ -305,7 +305,7 @@ class RealtimePlugin extends Plugin
 
     function _getScripts()
     {
-        return array(common_path('plugins/Realtime/realtimeupdate.js'));
+        return array('plugins/Realtime/realtimeupdate.js');
     }
 
     function _updateInitialize($timeline, $user_id)
index 2e5851ae531e539dc07f85a0d0eab80915a87fc8..0f7a680d73c8e41d9aa6e509cb0188765abe5c60 100644 (file)
@@ -130,7 +130,7 @@ RealtimeUpdate = {
           user = data['user'];
           html = data['html'].replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&quot;/g,'"').replace(/&amp;/g,'&');
           source = data['source'].replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&quot;/g,'"').replace(/&amp;/g,'&');
-
+console.log(data);
           ni = "<li class=\"hentry notice\" id=\"notice-"+unique+"\">"+
                "<div class=\"entry-title\">"+
                "<span class=\"vcard author\">"+
index 3665214f85710c603f811763c78e08a7e7afe5e1..c585da43c4eceefbee2db7039c1babc36480d971 100644 (file)
@@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-define('RECAPTCHA', '0.2');
-
 require_once(INSTALLDIR.'/plugins/Recaptcha/recaptchalib.php');
 
 class RecaptchaPlugin extends Plugin
@@ -88,4 +86,16 @@ class RecaptchaPlugin extends Plugin
             return false;
         }
     }
+
+    function onPluginVersion(&$versions)
+    {
+        $versions[] = array('name' => 'Recaptcha',
+                            'version' => STATUSNET_VERSION,
+                            'author' => 'Eric Helgeson',
+                            'homepage' => 'http://status.net/wiki/Plugin:Recaptcha',
+                            'rawdescription' =>
+                            _m('Uses <a href="http://recaptcha.org/">Recaptcha</a> service to add a  '.
+                               'captcha to the registration page.'));
+        return true;
+    }
 }
index e9160ed9b98582e40ceeea6eb3384db47fe0f89c..57b53219e9848562d41b66a7d7dbc75ce988fa0e 100644 (file)
@@ -8,7 +8,10 @@ add "addPlugin('reverseUsernameAuthentication', array('setting'=>'value', 'setti
 
 Settings
 ========
-provider_name*: a unique name for this authentication provider.
+provider_name*: This is a identifier designated to the connection.
+    It's how StatusNet will refer to the authentication source.
+    For the most part, any name can be used, so long as each authentication source has a different identifier.
+    In most cases there will be only one authentication source used.
 password_changeable*: must be set to false. This plugin does not support changing passwords.
 authoritative (false): Set to true if this plugin's responses are authoritative (meaning if this fails, do check any other plugins or the internal password database).
 autoregistration (false): Set to true if users should be automatically created when they attempt to login.
index d9d2137f827dded3ade0f7ee6b2de6160a3f2679..dac5a158841a77a483fdd488f852b39dd6a1567a 100644 (file)
@@ -47,10 +47,13 @@ class ReverseUsernameAuthenticationPlugin extends AuthenticationPlugin
         return $username == strrev($password);
     }
 
-    function autoRegister($username)
+    function autoRegister($username, $nickname)
     {
+        if(is_null($nickname)){
+            $nickname = $username;
+        }
         $registration_data = array();
-        $registration_data['nickname'] = $username ;
+        $registration_data['nickname'] = $nickname ;
         return User::register($registration_data);
     }
 
diff --git a/plugins/TabFocus/TabFocusPlugin.php b/plugins/TabFocus/TabFocusPlugin.php
new file mode 100644 (file)
index 0000000..bf89c47
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Plugin to enable Twitter-like "tab-space" pattern for a user to submit a notice
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Plugin
+ * @package   StatusNet
+ * @author    Craig Andrews <candrews@integralblue.com>
+ * @author    Paul Irish <paul.irish@isobar.net>
+ * @copyright 2009 Craig Andrews http://candrews.integralblue.com
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('STATUSNET') && !defined('LACONICA')) {
+    exit(1);
+}
+
+class TabFocusPlugin extends Plugin
+{
+    function __construct()
+    {
+        parent::__construct();
+    }
+
+    function onEndShowScripts($action)
+    {
+        $action->script('plugins/TabFocus/tabfocus.js');
+    }
+
+    function onPluginVersion(&$versions)
+    {
+        $versions[] = array('name' => 'TabFocus',
+                            'version' => STATUSNET_VERSION,
+                            'author' => 'Craig Andrews and Paul Irish',
+                            'homepage' => 'http://status.net/wiki/Plugin:TabFocus',
+                            'rawdescription' =>
+                            _m('TabFocus changes the notice form behavior so that, while in the text area, pressing the tab key focuses the "Send" button, matching the behavor of Twitter.'));
+        return true;
+    }
+}
diff --git a/plugins/TabFocus/tabfocus.js b/plugins/TabFocus/tabfocus.js
new file mode 100644 (file)
index 0000000..e2c1c65
--- /dev/null
@@ -0,0 +1,7 @@
+jQuery(function($){
+  $('#notice_data-text').bind('keydown',function(e){
+    if (e.which==9) {
+      setTimeout(function(){  $('#notice_action-submit').focus();  },15);
+    }
+  });
+});
index ceb83b037f23dc714b02fe6cda5b2b6bd3d0c616..13e499d65eda5bba9e45c272e76555698706f91b 100644 (file)
@@ -252,8 +252,17 @@ function format_status($notice)
     $statustxt = preg_replace('/^@/', ' @', $notice->content);
 
     // Convert !groups to #hashes
+
+    // XXX: Make this an optional setting?
+
     $statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt);
 
+    if (mb_strlen($statustxt) > 140) {
+        $noticeUrl = common_shorten_url($notice->uri);
+        $urlLen = mb_strlen($noticeUrl);
+        $statustxt = mb_substr($statustxt, 0, 140 - ($urlLen + 3)) . ' … ' . $noticeUrl;
+    }
+
     return $statustxt;
 }
 
index 6676a87c803d5edfccd8bb05a94e27277adf25ce..0a59d36f83fbcad75d1bb0f9ed22042a65c2c6ac 100755 (executable)
@@ -53,7 +53,17 @@ if (have_option('i', 'id')) {
 
 if (!empty($user)) {
     if (empty($user->email)) {
-        print "No email registered for user '$user->nickname'\n";
+        # Check for unconfirmed emails
+        $unconfirmed_email = new Confirm_address();
+        $unconfirmed_email->user_id = $user->id;
+        $unconfirmed_email->address_type = 'email';
+        $unconfirmed_email->find(true);
+
+        if (empty($unconfirmed_email->address)) {
+            print "No email registered for user '$user->nickname'\n";
+        } else {
+            print "Unconfirmed Adress: $unconfirmed_email->address\n";
+        }
     } else {
         print "$user->email\n";
     }
@@ -65,7 +75,18 @@ if (have_option('e', 'email')) {
     $user->email = get_option_value('e', 'email');
     $user->find(false);
     if (!$user->fetch()) {
-        print "No users with email $user->email\n";
+        # Check unconfirmed emails
+        $unconfirmed_email = new Confirm_address();
+        $unconfirmed_email->address = $user->email;
+        $unconfirmed_email->address_type = 'email';
+        $unconfirmed_email->find(true);
+
+        if (empty($unconfirmed_email->user_id)) {
+            print "No users with email $user->email\n";
+        } else {
+            $user=User::staticGet('id', $unconfirmed_email->user_id);
+            print "Unconfirmed Address: $user->id $user->nickname\n";
+        }
         exit(0);
     }
     do {