]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge conflicts and kill a whole lot of trailing whitespace on lines.
authorMike Cochrane <mikec@mikenz.geek.nz>
Wed, 9 Jul 2008 22:46:30 +0000 (18:46 -0400)
committerMike Cochrane <mikec@mikenz.geek.nz>
Wed, 9 Jul 2008 22:46:30 +0000 (18:46 -0400)
darcs-hash:20080709224630-533db-b5399baef280133858dac9b89c2cd6a2aba9f861.gz

31 files changed:
actions/accesstoken.php
actions/finishimmediate.php
actions/login.php
actions/newnotice.php
actions/publicxrds.php
actions/register.php
actions/remotesubscribe.php
actions/showstream.php
classes/Avatar.php
classes/Confirm_address.php
classes/Consumer.php
classes/Nonce.php
classes/Notice.php
classes/Profile.php
classes/Queue_item.php
classes/Remember_me.php
classes/Remote_profile.php
classes/Reply.php
classes/Sms_carrier.php
classes/Subscription.php
classes/Token.php
classes/User.php
classes/User_openid.php
db/laconica.sql
fixup_replies.php
lib/action.php
lib/jabber.php
lib/oauthstore.php
lib/omb.php
lib/stream.php
lib/util.php

index 1c1db8fbc4f0aab97dfe72aaa2ef6550d1c95a90..80c4477d030e14f991480189c144525e9edb5ddc 100644 (file)
@@ -27,12 +27,12 @@ class AccesstokenAction extends Action {
                try {
                        common_debug('getting request from env variables', __FILE__);
                        $req = OAuthRequest::from_request();
-                       common_debug('getting a server', __FILE__);                     
+                       common_debug('getting a server', __FILE__);
                        $server = omb_oauth_server();
-                       common_debug('fetching the access token', __FILE__);                                            
+                       common_debug('fetching the access token', __FILE__);
                        $token = $server->fetch_access_token($req);
                        common_debug('got this token: "'.print_r($token,TRUE).'"', __FILE__);
-                       common_debug('printing the access token', __FILE__);                                            
+                       common_debug('printing the access token', __FILE__);
                        print $token;
                } catch (OAuthException $e) {
                        common_server_error($e->getMessage());
index 99c868f4673f34a5868125271ee2a8add53a25d9..6dbaa3d1c6f0510054721ba5e52e48b76749b2d9 100644 (file)
@@ -25,7 +25,7 @@ class FinishimmediateAction extends Action {
 
        function handle($args) {
                parent::handle($args);
-               
+
                $consumer = oid_consumer();
 
                $response = $consumer->complete(common_local_url('finishimmediate'));
@@ -36,7 +36,7 @@ class FinishimmediateAction extends Action {
                          $response->endpoint->canonicalID : $response->getDisplayIdentifier();
 
                        $user = oid_get_user($canonical);
-                       
+
                        if ($user) {
                                oid_update_user($user, $sreg);
                                oid_set_last($display); # refresh for another year
@@ -47,12 +47,12 @@ class FinishimmediateAction extends Action {
                }
 
                # Failure! Clear openid so we don't try it again
-               
+
                oid_clear_last();
                $this->go_backto();
                return;
        }
-       
+
        function go_backto() {
                common_ensure_session();
                $backto = $_SESSION['openid_immediate_backto'];
index 400957e05b1c5fa2185f06ddb8f70775a4a2e37c..649f7ec9a4f695de80b4fe43bd9d0634a25b52fa 100644 (file)
@@ -31,7 +31,7 @@ class LoginAction extends Action {
                        $this->show_form();
                }
        }
-       
+
        function check_login() {
                # XXX: form token in $_SESSION to prevent XSS
                # XXX: login throttle
@@ -40,7 +40,7 @@ class LoginAction extends Action {
                if (common_check_user($nickname, $password)) {
                        # success!
                        if (!common_set_user($nickname)) {
-                               common_server_error(_t('Error setting user.'));
+                               common_server_error(_('Error setting user.'));
                                return;
                        }
                        common_real_login(true);
@@ -60,11 +60,18 @@ class LoginAction extends Action {
                        }
                        common_redirect($url);
                } else {
-                       $this->show_form(_t('Incorrect username or password.'));
+                       $this->show_form(_('Incorrect username or password.'));
+                       return;
+               }
+
+               # success!
+               if (!common_set_user($user)) {
+                       common_server_error(_t('Error setting user.'));
+                       return;
                }
-               
+
                common_real_login(true);
-               
+
                if ($this->boolean('rememberme')) {
                        common_debug('Adding rememberme cookie for ' . $nickname);
                        common_rememberme($user);
@@ -102,7 +109,7 @@ class LoginAction extends Action {
        }
 
        function get_instructions() {
-               return _t('Login with your username and password. ' .
+               return _('Login with your username and password. ' .
                                  'Don\'t have a username yet? ' .
                                  '[Register](%%action.register%%) a new account, or ' .
                                  'try [OpenID](%%action.openidlogin%%). ');
index de8e9ec2783d2510ab53bdabaaf41b240aaf20cc..107665fb79d90719c40ec9782b2e658f4670c8a9 100644 (file)
@@ -90,7 +90,14 @@ class NewnoticeAction extends Action {
 
        function show_form($msg=NULL) {
                $content = $this->trimmed('status_textarea');
-               common_show_header(_t('New notice'), NULL, $content,
+               if (!$content) {
+                       $replyto = $this->trimmed('replyto');
+                       $profile = Profile::staticGet('nickname', $replyto);
+                       if ($profile) {
+                               $content = '@' . $profile->nickname . ' ';
+                       }
+               }
+               common_show_header(_('New notice'), NULL, $content,
                                   array($this, 'show_top'));
                if ($msg) {
                        common_element('p', 'error', $msg);
index c41c3b2a84be502815dbc9519e0a05d5cf762ae9..29c8e13145f25ded8c342c9b866ba12fc1250516 100644 (file)
@@ -26,14 +26,14 @@ require_once(INSTALLDIR.'/lib/openid.php');
 class PublicxrdsAction extends Action {
 
        function handle($args) {
-               
+
                parent::handle($args);
-               
+
                header('Content-Type: application/xrds+xml');
 
                common_start_xml();
                common_element_start('XRDS', array('xmlns' => 'xri://$xrds'));
-               
+
                common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
                                                                                  'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
                                                                                  'version' => '2.0'));
@@ -44,13 +44,13 @@ class PublicxrdsAction extends Action {
                        $this->show_service(Auth_OpenID_RP_RETURN_TO_URL_TYPE,
                                                                common_local_url($finish));
                }
-               
+
                common_element_end('XRD');
-               
+
                common_element_end('XRDS');
                common_end_xml();
        }
-       
+
        function show_service($type, $uri, $params=NULL, $sigs=NULL, $localId=NULL) {
                common_element_start('Service');
                if ($uri) {
index 0ee332f0f24489ec9e9d98b6f75abd2608f78188..45446dce6a71717f066283ae86969a8bdc23e73c 100644 (file)
@@ -68,7 +68,7 @@ class RegisterAction extends Action {
                        if (!$user) {
                                $this->show_form(_t('Invalid username or password.'));
                                return;
-                       }                               
+                       }
                        # success!
                        if (!common_set_user($user)) {
                                common_server_error(_('Error setting user.'));
@@ -82,7 +82,7 @@ class RegisterAction extends Action {
                        }
                        common_redirect(common_local_url('profilesettings'));
                } else {
-                       $this->show_form(_t('Invalid username or password.'));
+                       $this->show_form(_('Invalid username or password.'));
                }
        }
 
index a37ca8c3ff91f1fdf8e9ff303b5ffb9e51466697..fca8a71ea22b765abc37df2bb51be78bbc40b26d 100644 (file)
@@ -64,7 +64,7 @@ class RemotesubscribeAction extends Action {
                $profile = $this->trimmed('profile_url');
                common_show_header(_('Remote subscribe'), NULL, $err,
                                                   array($this, 'show_top'));
-               # id = remotesubscribe conflicts with the 
+               # id = remotesubscribe conflicts with the
                # button on profile page
                common_element_start('form', array('id' => 'remsub', 'method' => 'post',
                                                                                   'action' => common_local_url('remotesubscribe')));
index d1d040a276d5db5930942d555c86f865c3df0d68..2a2d9d3b4de6d78b2f973fbfa2f8213258f1106a 100644 (file)
@@ -375,14 +375,6 @@ class ShowstreamAction extends StreamAction {
                                                                  'href' => $noticeurl,
                                                                  'title' => common_exact_date($notice->created)),
                                           common_date_string($notice->created));
-               if ($notice->reply_to) {
-                       $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to));
-                       common_text(' (');
-                       common_element('a', array('class' => 'inreplyto',
-                                                                         'href' => $replyurl),
-                                                  _t('in reply to...'));
-                       common_text(')');
-               }
                common_element_start('a', 
                                                         array('href' => common_local_url('newnotice',
                                                                                                                          array('replyto' => $profile->nickname)),
index 1807770534b0a82c075784ebd33ac332d45b8bf8..9d7d7f770334c2dd39a3b3bbe1d4729e1ad71e7c 100644 (file)
@@ -4,18 +4,18 @@
  */
 require_once 'DB/DataObject.php';
 
-class Avatar extends DB_DataObject 
+class Avatar extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
 
     public $__table = 'avatar';                          // table name
     public $profile_id;                      // int(4)  primary_key not_null
-    public $original;                        // tinyint(1)  
+    public $original;                        // tinyint(1)
     public $width;                           // int(4)  primary_key not_null
     public $height;                          // int(4)  primary_key not_null
     public $mediatype;                       // varchar(32)   not_null
-    public $filename;                        // varchar(255)  
+    public $filename;                        // varchar(255)
     public $url;                             // varchar(255)  unique_key
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
@@ -27,7 +27,7 @@ class Avatar extends DB_DataObject
     ###END_AUTOCODE
 
        # We clean up the file, too
-       
+
        function delete() {
                $filename = $this->filename;
                if (parent::delete()) {
@@ -36,8 +36,8 @@ class Avatar extends DB_DataObject
        }
 
        # Create and save scaled version of this avatar
-       # XXX: maybe break into different methods 
-       
+       # XXX: maybe break into different methods
+
        function scale($size) {
 
                $image_s = imagecreatetruecolor($size, $size);
index d6d0d77960e64e7c6245c289f8c07a01eaae7c75..7b2962925c64360955c064c1bb6a0cd505308748 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class Confirm_address extends DB_DataObject 
+class Confirm_address extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -15,8 +15,8 @@ class Confirm_address extends DB_DataObject
     public $address;                         // varchar(255)   not_null
     public $address_extra;                   // varchar(255)   not_null
     public $address_type;                    // varchar(8)   not_null
-    public $claimed;                         // datetime()  
-    public $sent;                            // datetime()  
+    public $claimed;                         // datetime()
+    public $sent;                            // datetime()
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
     /* Static get */
@@ -24,6 +24,6 @@ class Confirm_address extends DB_DataObject
 
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
-       
+
     function sequenceKey() { return array(false, false); }
 }
index 6f4513f332847652d7d28b4b7f749488e5592b42..4b7cb414b39505ea06cf59923a8945203d3f5620 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class Consumer extends DB_DataObject 
+class Consumer extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
index 987e8d1e85c1fd18b9573a3ef021d889787d5c2f..1a3f3586899e6a82a71081c98c12fb6e468e70ab 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class Nonce extends DB_DataObject 
+class Nonce extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
index a00114f95df2043db1a0258c7c009ceb629e6352..5a500a3aa72f20de2538e1ae581bdba209b034d8 100644 (file)
@@ -24,7 +24,7 @@ if (!defined('LACONICA')) { exit(1); }
  */
 require_once 'DB/DataObject.php';
 
-class Notice extends DB_DataObject 
+class Notice extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -34,7 +34,6 @@ class Notice extends DB_DataObject
     public $profile_id;                      // int(4)   not_null
     public $uri;                             // varchar(255)  unique_key
     public $content;                         // varchar(140)  
-    public $rendered;                        // text()  
     public $url;                             // varchar(255)  
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
index 0cf1397c73176f0b6321519ce660900013f647c3..827339a602f7c65cbb9596bdc8792795651e5737 100644 (file)
@@ -24,19 +24,19 @@ if (!defined('LACONICA')) { exit(1); }
  */
 require_once 'DB/DataObject.php';
 
-class Profile extends DB_DataObject 
+class Profile extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
 
     public $__table = 'profile';                         // table name
     public $id;                              // int(4)  primary_key not_null
-    public $nickname;                        // varchar(64)  multiple_key not_null
-    public $fullname;                        // varchar(255)  multiple_key
+    public $nickname;                        // varchar(64)   not_null
+    public $fullname;                        // varchar(255)  
     public $profileurl;                      // varchar(255)  
-    public $homepage;                        // varchar(255)  multiple_key
-    public $bio;                             // varchar(140)  multiple_key
-    public $location;                        // varchar(255)  multiple_key
+    public $homepage;                        // varchar(255)  
+    public $bio;                             // varchar(140)  
+    public $location;                        // varchar(255)  
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
@@ -133,7 +133,7 @@ class Profile extends DB_DataObject
                }
                return true;
        }
-       
+
        function getBestName() {
                return ($this->fullname) ? $this->fullname : $this->nickname;
        }
index 964013f2c8e4da70ccbf299dfb0aeddceccbaa88..4a7aeebe2822710c6a97a79989be8190e959118a 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class Queue_item extends DB_DataObject 
+class Queue_item extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -12,13 +12,13 @@ class Queue_item extends DB_DataObject
     public $__table = 'queue_item';                      // table name
     public $notice_id;                       // int(4)  primary_key not_null
     public $created;                         // datetime()   not_null
-    public $claimed;                         // datetime()  
+    public $claimed;                         // datetime()
 
     /* Static get */
     function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Queue_item',$k,$v); }
 
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
-       
+
     function sequenceKey() { return array(false, false); }
 }
index 92a1e461771a803a695b8c31d83cfe8946a31f7c..31a09ab4131a219d04699e3d46c49fdcfcc42d16 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class Remember_me extends DB_DataObject 
+class Remember_me extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -19,6 +19,6 @@ class Remember_me extends DB_DataObject
 
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
-       
+
     function sequenceKey() { return array(false, false); }
 }
index e5613125dcf5d564f5ae8aec77ecb07887a87ed6..216c989e7d0b12b51601e1bbbaf61be69c8346fe 100644 (file)
@@ -24,7 +24,7 @@ if (!defined('LACONICA')) { exit(1); }
  */
 require_once 'DB/DataObject.php';
 
-class Remote_profile extends DB_DataObject 
+class Remote_profile extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -32,8 +32,8 @@ class Remote_profile extends DB_DataObject
     public $__table = 'remote_profile';                  // table name
     public $id;                              // int(4)  primary_key not_null
     public $uri;                             // varchar(255)  unique_key
-    public $postnoticeurl;                   // varchar(255)  
-    public $updateprofileurl;                // varchar(255)  
+    public $postnoticeurl;                   // varchar(255)
+    public $updateprofileurl;                // varchar(255)
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
index 8e26f1684ebcd874698e2e7ef2c865a7dabdc76e..507782391b7a06630e72fb7e95b4d11629fa6a27 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class Reply extends DB_DataObject 
+class Reply extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -12,6 +12,7 @@ class Reply extends DB_DataObject
     public $__table = 'reply';                           // table name
     public $notice_id;                       // int(4)  primary_key not_null
     public $profile_id;                      // int(4)  primary_key not_null
+    public $replied_id;                      // int(4)  
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
     public $replied_id;                      // int(4)  
 
index 5fb7417317a5a1ad03c8f20bf9e5136fe159544a..45bb29cffa5eeeaf4cd80f7356c2a0540e884cd7 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class Sms_carrier extends DB_DataObject 
+class Sms_carrier extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
index 2a1037d2bc1ca292f37b38c114ebb9addd164e35..dd7b0f3dbba62995de2a7c626abdcf574ae9e0ef 100644 (file)
@@ -24,7 +24,7 @@ if (!defined('LACONICA')) { exit(1); }
  */
 require_once 'DB/DataObject.php';
 
-class Subscription extends DB_DataObject 
+class Subscription extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -32,8 +32,8 @@ class Subscription extends DB_DataObject
     public $__table = 'subscription';                    // table name
     public $subscriber;                      // int(4)  primary_key not_null
     public $subscribed;                      // int(4)  primary_key not_null
-    public $token;                           // varchar(255)  
-    public $secret;                          // varchar(255)  
+    public $token;                           // varchar(255)
+    public $secret;                          // varchar(255)
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
index a91b19f8e7dcbb464d92a0e063d0665d90d94221..cd14fbfffff4b6e74deed3d2e592f51ecc7f9017 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class Token extends DB_DataObject 
+class Token extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -14,7 +14,7 @@ class Token extends DB_DataObject
     public $tok;                             // char(32)  primary_key not_null
     public $secret;                          // char(32)   not_null
     public $type;                            // tinyint(1)   not_null
-    public $state;                           // tinyint(1)  
+    public $state;                           // tinyint(1)
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
index ab550b8e1a47ea71770e5df611505f7151720df9..b928b69cacb2a63e19cdc7387dc44ec9cd996191 100644 (file)
@@ -24,7 +24,7 @@ if (!defined('LACONICA')) { exit(1); }
 require_once 'DB/DataObject.php';
 require_once 'Validate.php';
 
-class User extends DB_DataObject 
+class User extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -32,14 +32,14 @@ class User extends DB_DataObject
     public $__table = 'user';                            // table name
     public $id;                              // int(4)  primary_key not_null
     public $nickname;                        // varchar(64)  unique_key
-    public $password;                        // varchar(255)  
+    public $password;                        // varchar(255)
     public $email;                           // varchar(255)  unique_key
     public $jabber;                          // varchar(255)  unique_key
-    public $jabbernotify;                    // tinyint(1)  
-    public $updatefrompresence;              // tinyint(1)  
+    public $jabbernotify;                    // tinyint(1)
+    public $updatefrompresence;              // tinyint(1)
     public $sms;                             // varchar(64)  unique_key
-    public $carrier;                         // int(4)  
-    public $smsnotify;                       // tinyint(1)  
+    public $carrier;                         // int(4)
+    public $smsnotify;                       // tinyint(1)
     public $uri;                             // varchar(255)  unique_key
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
@@ -69,7 +69,7 @@ class User extends DB_DataObject
        }
 
        # 'update' won't write key columns, so we have to do it ourselves.
-       
+
        function updateKeys(&$orig) {
                $parts = array();
                foreach (array('nickname', 'email', 'jabber', 'sms', 'carrier') as $k) {
@@ -82,11 +82,11 @@ class User extends DB_DataObject
                        return true;
                }
                $toupdate = implode(', ', $parts);
-               $qry = 'UPDATE ' . $this->tableName() . ' SET ' . $toupdate . 
+               $qry = 'UPDATE ' . $this->tableName() . ' SET ' . $toupdate .
                  ' WHERE id = ' . $this->id;
                return $this->query($qry);
        }
-       
+
        function allowed_nickname($nickname) {
                # XXX: should already be validated for size, content, etc.
                static $blacklist = array('rss', 'xrds', 'doc', 'main',
index 67f6f3b2efa592e419a68ff38bbcbacd98c99b41..b199685f8ed50ef377f3ac838a14e3126971e373 100644 (file)
@@ -4,7 +4,7 @@
  */
 require_once 'DB/DataObject.php';
 
-class User_openid extends DB_DataObject 
+class User_openid extends DB_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
index 4a89544d8014f145f7b36baebd8d46f1382e812a..42a00da3f0c1b62011cab9603ea1ba14a88f7036 100644 (file)
@@ -201,6 +201,6 @@ create table queue_item (
     claimed datetime comment 'date this item was claimed',
 
     index queue_item_created_idx (created)
-    
+
 ) ENGINE=MyISAM;
 
index a9ada0756b7627a067b0820e6093a4a643bef526..51ecf7afaa4c1ca59d22e4fec81f8b883bfdc5fb 100755 (executable)
@@ -20,8 +20,8 @@
 
 # Abort if called from a web server
 if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
-       print "This script must be run from the command line\n";
-       exit();
+    print "This script must be run from the command line\n";
+    exit();
 }
 
 define('INSTALLDIR', dirname(__FILE__));
@@ -35,6 +35,6 @@ $notice = new Notice();
 $cnt = $notice->find();
 
 while ($notice->fetch()) {
-       common_log(LOG_INFO, 'Getting replies for notice #' . $notice->id);
-       common_save_replies($notice);
+    common_log(LOG_INFO, 'Getting replies for notice #' . $notice->id);
+    common_save_replies($notice);
 }
index 79c924b5ea98abd4208e61c1e1c1788c0a8e0e6d..b36312e40925103afabad62ef7db1a62877f6613 100644 (file)
@@ -38,14 +38,14 @@ class Action { // lawsuit
                $arg = $this->arg($key, $def);
                return (is_string($arg)) ? trim($arg) : $arg;
        }
-       
+
        function handle($argarray) {
                $this->args =& common_copy_args($argarray);
        }
-       
+
        function boolean($key, $def=false) {
                $arg = strtolower($this->trimmed($key));
-               
+
                if (is_null($arg)) {
                        return $def;
                } else if (in_array($arg, array('true', 'yes', '1'))) {
@@ -56,19 +56,19 @@ class Action { // lawsuit
                        return $def;
                }
        }
-       
+
        function server_error($msg, $code=500) {
                $action = $this->trimmed('action');
                common_debug("Server error '$code' on '$action': $msg", __FILE__);
                common_server_error($msg, $code);
        }
-       
+
        function client_error($msg, $code=400) {
                $action = $this->trimmed('action');
                common_debug("User error '$code' on '$action': $msg", __FILE__);
                common_user_error($msg, $code);
        }
-       
+
        function self_url() {
                $action = $this->trimmed('action');
                $args = $this->args;
index 66ff24e63a792eb4fa43a861eb47b9e2558a5848..a36e19044e5dcb2a3e2da5c0a7b8f4c16ac33513 100644 (file)
@@ -133,7 +133,7 @@ function jabber_broadcast_notice($notice) {
                while ($sub->fetch()) {
                        $user = User::staticGet($sub->subscriber);
                        if ($user && $user->jabber && $user->jabbernotify) {
-                               common_log(LOG_INFO, 
+                               common_log(LOG_INFO,
                                                   'Sending notice ' . $notice->id . ' to ' . $user->jabber,
                                                   __FILE__);
                                $success = jabber_send_message($user->jabber, $msg);
index 13187211a67579a19eac721b8f5ebf56694c26f8..d7f9c9ff1b91b9959aafa8365612ce09fb15e022 100644 (file)
@@ -24,7 +24,7 @@ require_once(INSTALLDIR.'/lib/omb.php');
 class LaconicaOAuthDataStore extends OAuthDataStore {
 
        # We keep a record of who's contacted us
-       
+
        function lookup_consumer($consumer_key) {
                $con = Consumer::staticGet('consumer_key', $consumer_key);
                if (!$con) {
@@ -38,7 +38,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
                }
                return new OAuthConsumer($con->consumer_key, '');
        }
-       
+
        function lookup_token($consumer, $token_type, $token_key) {
                $t = new Token();
                $t->consumer_key = $consumer->key;
@@ -50,7 +50,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
                        return NULL;
                }
        }
-       
+
        function lookup_nonce($consumer, $token, $nonce, $timestamp) {
                $n = new Nonce();
                $n->consumer_key = $consumer->key;
@@ -65,7 +65,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
                        return FALSE;
                }
        }
-       
+
        function new_request_token($consumer) {
                $t = new Token();
                $t->consumer_key = $consumer->key;
@@ -82,11 +82,11 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
        }
 
        # defined in OAuthDataStore, but not implemented anywhere
-       
+
        function fetch_request_token($consumer) {
                return $this->new_request_token($consumer);
        }
-       
+
        function new_access_token($token, $consumer) {
                common_debug('new_access_token("'.$token->key.'","'.$consumer->key.'")', __FILE__);
                $rt = new Token();
@@ -112,7 +112,7 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
                                $rt->state = 2; # used
                                if (!$rt->update($orig_rt)) {
                                        return NULL;
-                               } 
+                               }
                                common_debug('request token "'.$rt->tok.'" updated', __FILE__);
                                # Update subscription
                                # XXX: mixing levels here
@@ -129,15 +129,15 @@ class LaconicaOAuthDataStore extends OAuthDataStore {
                                } else {
                                        common_debug('subscription updated to use access token', __FILE__);
                                        return new OAuthToken($at->tok, $at->secret);
-                               }                                       
+                               }
                        }
                } else {
                        return NULL;
                }
        }
-       
+
        # defined in OAuthDataStore, but not implemented anywhere
-       
+
        function fetch_access_token($consumer) {
                return $this->new_access_token($consumer);
        }
index 89d7f4145a99196af4c5761271306ee6b90480e2..0bc537db36417d018758069762ae9eb4cbb68ee4 100644 (file)
@@ -152,7 +152,7 @@ function omb_post_notice($notice, $remote_profile, $subscription) {
                                                                                                                   array('notice' =>
                                                                                                                                 $notice->id)));
        $req->set_parameter('omb_notice_license', $config['license']['url']);
-       
+
        $req->sign_request(omb_hmac_sha1(), $con, $token);
 
        # We re-use this tool's fetcher, since it's pretty good
@@ -163,13 +163,13 @@ function omb_post_notice($notice, $remote_profile, $subscription) {
                                                         $req->to_postdata());
 
        common_debug('Got HTTP result "'.print_r($result,TRUE).'"', __FILE__);
-       
+
        if ($result->status == 403) { # not authorized, don't send again
                common_debug('403 result, deleting subscription', __FILE__);
                $subscription->delete();
                return false;
        } else if ($result->status != 200) {
-               common_debug('Error status '.$result->status, __FILE__);                
+               common_debug('Error status '.$result->status, __FILE__);
                return false;
        } else { # success!
                parse_str($result->body, $return);
@@ -216,22 +216,22 @@ function omb_update_profile($profile, $remote_profile, $subscription) {
        $req->set_parameter('omb_listenee', $user->uri);
        $req->set_parameter('omb_listenee_profile', common_profile_url($profile->nickname));
        $req->set_parameter('omb_listenee_nickname', $profile->nickname);
-       
+
        # We use blanks to force emptying any existing values in these optional fields
-       
+
        $req->set_parameter('omb_listenee_fullname',
                                                ($profile->fullname) ? $profile->fullname : '');
-       $req->set_parameter('omb_listenee_homepage', 
+       $req->set_parameter('omb_listenee_homepage',
                                                ($profile->homepage) ? $profile->homepage : '');
-       $req->set_parameter('omb_listenee_bio', 
+       $req->set_parameter('omb_listenee_bio',
                                                ($profile->bio) ? $profile->bio : '');
        $req->set_parameter('omb_listenee_location',
                                                ($profile->location) ? $profile->location : '');
-       
+
        $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
-       $req->set_parameter('omb_listenee_avatar', 
+       $req->set_parameter('omb_listenee_avatar',
                                                ($avatar) ? $avatar->url : '');
-       
+
        $req->sign_request(omb_hmac_sha1(), $con, $token);
 
        # We re-use this tool's fetcher, since it's pretty good
@@ -244,13 +244,13 @@ function omb_update_profile($profile, $remote_profile, $subscription) {
                                                         $req->to_postdata());
 
        common_debug('Got HTTP result "'.print_r($result,TRUE).'"', __FILE__);
-       
+
        if ($result->status == 403) { # not authorized, don't send again
                common_debug('403 result, deleting subscription', __FILE__);
                $subscription->delete();
                return false;
        } else if ($result->status != 200) {
-               common_debug('Error status '.$result->status, __FILE__);                
+               common_debug('Error status '.$result->status, __FILE__);
                return false;
        } else { # success!
                parse_str($result->body, $return);
index a908b48e8a6bb5be139e742cddbff2ae03ea1e0f..d6180f4edde0226d52f7e6926c7fa52c8203bd60 100644 (file)
@@ -101,7 +101,7 @@ class StreamAction extends Action {
                                                   _t(' in reply to...'));
                        common_text(')');
                }
-               common_element_start('a', 
+               common_element_start('a',
                                                         array('href' => common_local_url('newnotice',
                                                                                                                          array('replyto' => $profile->nickname)),
                                                                   'onclick' => 'doreply("'.$profile->nickname.'"); return false',
index f4245693fb8f7499dc22d5c952c3ee87068fe01a..1af5d1177005be22c2d242ca688e8180f8861125 100644 (file)
@@ -95,7 +95,7 @@ function common_element_start($tag, $attrs=NULL) {
 function common_element_end($tag) {
        static $empty_tag = array('base', 'meta', 'link', 'hr',
                                                          'br', 'param', 'img', 'area',
-                                                         'input', 'col'); 
+                                                         'input', 'col');
        global $xw;
        # XXX: check namespace
        if (in_array($tag, $empty_tag)) {
@@ -460,7 +460,7 @@ function common_set_user($user) {
        } else if (!($user instanceof User)) {
                return false;
        }
-       
+
        if ($user) {
                common_ensure_session();
                $_SESSION['userid'] = $user->id;