X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fomb.php;h=4f6a9609541ded863edcc62edef1ffcff10f4283;hb=11086c78239a30dc47622837a2800d899ebf9b0f;hp=c302a7b649c2918ef0429a56cc0f50bf6ff9cfb7;hpb=e8e40439961160989c32e1cd661ecce94b75fcee;p=quix0rs-gnu-social.git diff --git a/lib/omb.php b/lib/omb.php index c302a7b649..4f6a960954 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -1,7 +1,7 @@ id . ' to ' . $postnoticeurl, __FILE__); - $user = User::staticGet('id', $notice->profile_id); if (!$user) { - common_debug('Failed to get user for notice ' . $notice->id . ', profile = ' . $notice->profile_id, __FILE__); return false; } @@ -208,8 +204,6 @@ function omb_post_notice_keys($notice, $postnoticeurl, $tk, $secret) $req->to_postdata(), array('User-Agent: Laconica/' . LACONICA_VERSION)); - 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__); # FIXME: figure out how to delete this @@ -251,7 +245,6 @@ function omb_broadcast_profile($profile) function omb_update_profile($profile, $remote_profile, $subscription) { - global $config; # for license URL $user = User::staticGet($profile->id); $con = omb_oauth_consumer(); $token = new OAuthToken($subscription->token, $subscription->secret); @@ -287,14 +280,10 @@ function omb_update_profile($profile, $remote_profile, $subscription) $fetcher = Auth_Yadis_Yadis::getHTTPFetcher(); - common_debug('request URL = '.$req->get_normalized_http_url(), __FILE__); - common_debug('postdata = '.$req->to_postdata(), __FILE__); $result = $fetcher->post($req->get_normalized_http_url(), $req->to_postdata(), array('User-Agent: Laconica/' . LACONICA_VERSION)); - common_debug('Got HTTP result "'.print_r($result,true).'"', __FILE__); - if (empty($result) || !$result) { common_debug("Unable to contact " . $req->get_normalized_http_url()); } else if ($result->status == 403) { # not authorized, don't send again @@ -306,7 +295,7 @@ function omb_update_profile($profile, $remote_profile, $subscription) return false; } else { # success! parse_str($result->body, $return); - if ($return['omb_version'] == OMB_VERSION_01) { + if (isset($return['omb_version']) && $return['omb_version'] === OMB_VERSION_01) { return true; } else { return false;