From 4a7c3b9eefd381bb5c77a96a4311ceb558a1c1a5 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 20 Dec 2016 12:44:15 -0500 Subject: [PATCH] Diaspora: Fix class name case + add self --- include/Contact.php | 2 +- include/api.php | 2 +- include/contact_selectors.php | 2 +- include/delivery.php | 10 +++++----- include/diaspora.php | 8 ++++---- include/follow.php | 2 +- include/like.php | 2 +- include/notifier.php | 2 +- include/profile_update.php | 2 +- include/queue.php | 2 +- mod/dfrn_confirm.php | 2 +- mod/fetch.php | 6 +++--- mod/item.php | 2 +- mod/p.php | 4 ++-- mod/receive.php | 6 +++--- object/Item.php | 2 +- 16 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/Contact.php b/include/Contact.php index 8a33e3fe91..83be830469 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -115,7 +115,7 @@ function terminate_friendship($user,$self,$contact) { } elseif($contact['network'] === NETWORK_DIASPORA) { require_once('include/diaspora.php'); - diaspora::send_unshare($user,$contact); + Diaspora::send_unshare($user,$contact); } elseif($contact['network'] === NETWORK_DFRN) { require_once('include/dfrn.php'); diff --git a/include/api.php b/include/api.php index 1f3c762989..6253a2280a 100644 --- a/include/api.php +++ b/include/api.php @@ -3218,7 +3218,7 @@ function api_share_as_retweet(&$item) { $body = trim($item["body"]); - if (diaspora::is_reshare($body, false)===false) { + if (Diaspora::is_reshare($body, false)===false) { return false; } diff --git a/include/contact_selectors.php b/include/contact_selectors.php index 35c9d983d7..5e9c06aed7 100644 --- a/include/contact_selectors.php +++ b/include/contact_selectors.php @@ -99,7 +99,7 @@ function network_to_name($s, $profile = "") { $networkname = str_replace($search,$replace,$s); - if (($s == NETWORK_DIASPORA) AND ($profile != "") AND diaspora::is_redmatrix($profile)) { + if (($s == NETWORK_DIASPORA) AND ($profile != "") AND Diaspora::is_redmatrix($profile)) { $networkname = t("Hubzilla/Redmatrix"); $r = q("SELECT `gserver`.`platform` FROM `gcontact` diff --git a/include/delivery.php b/include/delivery.php index 8fce987742..81152a2df2 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -508,7 +508,7 @@ function delivery_run(&$argv, &$argc){ break; if ($mail) { - diaspora::send_mail($item,$owner,$contact); + Diaspora::send_mail($item,$owner,$contact); break; } @@ -530,22 +530,22 @@ function delivery_run(&$argv, &$argc){ if (($target_item['deleted']) && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) { // top-level retraction logger('diaspora retract: '.$loc); - diaspora::send_retraction($target_item,$owner,$contact,$public_message); + Diaspora::send_retraction($target_item,$owner,$contact,$public_message); break; } elseif ($followup) { // send comments and likes to owner to relay logger('diaspora followup: '.$loc); - diaspora::send_followup($target_item,$owner,$contact,$public_message); + Diaspora::send_followup($target_item,$owner,$contact,$public_message); break; } elseif ($target_item['uri'] !== $target_item['parent-uri']) { // we are the relay - send comments, likes and relayable_retractions to our conversants logger('diaspora relay: '.$loc); - diaspora::send_relay($target_item,$owner,$contact,$public_message); + Diaspora::send_relay($target_item,$owner,$contact,$public_message); break; } elseif ($top_level && !$walltowall) { // currently no workable solution for sending walltowall logger('diaspora status: '.$loc); - diaspora::send_status($target_item,$owner,$contact,$public_message); + Diaspora::send_status($target_item,$owner,$contact,$public_message); break; } diff --git a/include/diaspora.php b/include/diaspora.php index 453f3cb9c4..dd8c00a6fb 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -23,7 +23,7 @@ require_once("include/queue_fn.php"); * @brief This class contain functions to create and send Diaspora XML files * */ -class diaspora { +class Diaspora { /** * @brief Return a list of relay servers @@ -344,7 +344,7 @@ class diaspora { // This will often be different with relayed messages (for example "like" and "comment") $sender = $msg["author"]; - if (!diaspora::valid_posting($msg, $fields)) { + if (!self::valid_posting($msg, $fields)) { logger("Invalid posting"); return false; } @@ -2444,7 +2444,7 @@ class diaspora { $b64url_data = base64url_encode($msg); $data = str_replace(array("\n", "\r", " ", "\t"), array("", "", "", ""), $b64url_data); - $key_id = base64url_encode(diaspora::my_handle($user)); + $key_id = base64url_encode(self::my_handle($user)); $type = "application/xml"; $encoding = "base64url"; $alg = "RSA-SHA256"; @@ -2970,7 +2970,7 @@ class diaspora { */ public static function send_status($item, $owner, $contact, $public_batch = false) { - $status = diaspora::build_status($item, $owner); + $status = self::build_status($item, $owner); return self::build_and_transmit($owner, $contact, $status["type"], $status["message"], $public_batch, $item["guid"]); } diff --git a/include/follow.php b/include/follow.php index 1c33edf80e..2cb72a6068 100644 --- a/include/follow.php +++ b/include/follow.php @@ -302,7 +302,7 @@ function new_contact($uid,$url,$interactive = false) { } if($contact['network'] == NETWORK_DIASPORA) { require_once('include/diaspora.php'); - $ret = diaspora::send_share($a->user,$contact); + $ret = Diaspora::send_share($a->user,$contact); logger('share returns: '.$ret); } } diff --git a/include/like.php b/include/like.php index 118ec81ca1..c2fa3bd199 100644 --- a/include/like.php +++ b/include/like.php @@ -239,7 +239,7 @@ EOT; // Save the author information for the like in case we need to relay to Diaspora - diaspora::store_like_signature($contact, $post_id); + Diaspora::store_like_signature($contact, $post_id); $arr['id'] = $post_id; diff --git a/include/notifier.php b/include/notifier.php index 812752a55c..37512ebd6a 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -570,7 +570,7 @@ function notifier_run(&$argv, &$argc){ if($public_message) { if (!$followup) - $r0 = diaspora::relay_list(); + $r0 = Diaspora::relay_list(); else $r0 = array(); diff --git a/include/profile_update.php b/include/profile_update.php index 399150f21c..7aa34d45d7 100644 --- a/include/profile_update.php +++ b/include/profile_update.php @@ -2,5 +2,5 @@ require_once('include/diaspora.php'); function profile_change() { - diaspora::send_profile(local_user()); + Diaspora::send_profile(local_user()); } diff --git a/include/queue.php b/include/queue.php index ad7079e959..852315878d 100644 --- a/include/queue.php +++ b/include/queue.php @@ -195,7 +195,7 @@ function queue_run(&$argv, &$argc){ case NETWORK_DIASPORA: if($contact['notify']) { logger('queue: diaspora_delivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>'); - $deliver_status = diaspora::transmit($owner,$contact,$data,$public,true); + $deliver_status = Diaspora::transmit($owner,$contact,$data,$public,true); if($deliver_status == (-1)) { update_queue_time($q_item['id']); diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 5aea4eede9..45243900c2 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -433,7 +433,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if(($contact) && ($contact['network'] === NETWORK_DIASPORA)) { require_once('include/diaspora.php'); - $ret = diaspora::send_share($user[0],$r[0]); + $ret = Diaspora::send_share($user[0],$r[0]); logger('share returns: ' . $ret); } diff --git a/mod/fetch.php b/mod/fetch.php index 1c73ad3718..753e286be7 100644 --- a/mod/fetch.php +++ b/mod/fetch.php @@ -50,12 +50,12 @@ function fetch_init($a){ } $user = $r[0]; - $status = diaspora::build_status($item[0], $user); - $xml = diaspora::build_post_xml($status["type"], $status["message"]); + $status = Diaspora::build_status($item[0], $user); + $xml = Diaspora::build_post_xml($status["type"], $status["message"]); // Send the envelope header("Content-Type: application/magic-envelope+xml; charset=utf-8"); - echo diaspora::build_magic_envelope($xml, $user); + echo Diaspora::build_magic_envelope($xml, $user); killme(); } diff --git a/mod/item.php b/mod/item.php index 170bed12a5..c8575a961e 100644 --- a/mod/item.php +++ b/mod/item.php @@ -952,7 +952,7 @@ function item_post(&$a) { // Store the comment signature information in case we need to relay to Diaspora - diaspora::store_comment_signature($datarray, $author, ($self ? $user['prvkey'] : false), $post_id); + Diaspora::store_comment_signature($datarray, $author, ($self ? $user['prvkey'] : false), $post_id); } else { $parent = $post_id; diff --git a/mod/p.php b/mod/p.php index 8da044e932..8d535145dc 100644 --- a/mod/p.php +++ b/mod/p.php @@ -54,8 +54,8 @@ function p_init($a){ } $user = $r[0]; - $status = diaspora::build_status($item[0], $user); - $xml = diaspora::build_post_xml($status["type"], $status["message"]); + $status = Diaspora::build_status($item[0], $user); + $xml = Diaspora::build_post_xml($status["type"], $status["message"]); header("Content-Type: application/xml; charset=utf-8"); echo $xml; diff --git a/mod/receive.php b/mod/receive.php index 4991ac47e8..571bac6def 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -53,7 +53,7 @@ function receive_post(&$a) { logger('mod-diaspora: message is okay', LOGGER_DEBUG); - $msg = diaspora::decode($importer,$xml); + $msg = Diaspora::decode($importer,$xml); logger('mod-diaspora: decoded', LOGGER_DEBUG); @@ -66,9 +66,9 @@ function receive_post(&$a) { $ret = 0; if($public) { - diaspora::dispatch_public($msg); + Diaspora::dispatch_public($msg); } else { - $ret = diaspora::dispatch($importer,$msg); + $ret = Diaspora::dispatch($importer,$msg); } http_status_exit(($ret) ? $ret : 200); diff --git a/object/Item.php b/object/Item.php index 9f01ac59b0..e6a777d8d6 100644 --- a/object/Item.php +++ b/object/Item.php @@ -334,7 +334,7 @@ class Item extends BaseObject { // Diaspora isn't able to do likes on comments - but red does if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment') AND - !diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) + !Diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) unset($buttons["like"]); // Diaspora doesn't has multithreaded comments