From 4b656f47dff2bd6eed4dcfad060b8434d052d883 Mon Sep 17 00:00:00 2001 From: Mike Cochrane Date: Wed, 9 Jul 2008 18:46:30 -0400 Subject: Merge conflicts and kill a whole lot of trailing whitespace on lines. darcs-hash:20080709224630-533db-b5399baef280133858dac9b89c2cd6a2aba9f861.gz --- lib/action.php | 12 ++++++------ lib/jabber.php | 2 +- lib/oauthstore.php | 20 ++++++++++---------- lib/omb.php | 24 ++++++++++++------------ lib/stream.php | 2 +- lib/util.php | 4 ++-- 6 files changed, 32 insertions(+), 32 deletions(-) (limited to 'lib') diff --git a/lib/action.php b/lib/action.php index 79c924b5e..b36312e40 100644 --- a/lib/action.php +++ b/lib/action.php @@ -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; diff --git a/lib/jabber.php b/lib/jabber.php index 66ff24e63..a36e19044 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -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); diff --git a/lib/oauthstore.php b/lib/oauthstore.php index 13187211a..d7f9c9ff1 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -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); } diff --git a/lib/omb.php b/lib/omb.php index 89d7f4145..0bc537db3 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -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); diff --git a/lib/stream.php b/lib/stream.php index a908b48e8..d6180f4ed 100644 --- a/lib/stream.php +++ b/lib/stream.php @@ -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', diff --git a/lib/util.php b/lib/util.php index f4245693f..1af5d1177 100644 --- a/lib/util.php +++ b/lib/util.php @@ -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; -- cgit v1.2.3-54-g00ecf