]> git.mxchange.org Git - friendica.git/commitdiff
Diaspora: Fix class name case + add self
authorHypolite Petovan <mrpetovan@gmail.com>
Tue, 20 Dec 2016 17:44:15 +0000 (12:44 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Tue, 20 Dec 2016 17:44:15 +0000 (12:44 -0500)
16 files changed:
include/Contact.php
include/api.php
include/contact_selectors.php
include/delivery.php
include/diaspora.php
include/follow.php
include/like.php
include/notifier.php
include/profile_update.php
include/queue.php
mod/dfrn_confirm.php
mod/fetch.php
mod/item.php
mod/p.php
mod/receive.php
object/Item.php

index 8a33e3fe9161e865c6b1e2fa507ea4de7ad29d0c..83be830469b9124bdfcd70e194819e9cb5997c37 100644 (file)
@@ -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');
index 1f3c762989f3f2c5850fdfd4327768307b545060..6253a2280a6fa55988be52b12d5bf0d37a6bf555 100644 (file)
        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;
                }
 
index 35c9d983d72797f49ac49f46da496d93d1bfed48..5e9c06aed7341acf5bfba78571d9d93f04874e22 100644 (file)
@@ -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`
index 8fce98774250cdaeeaccda7bd841671cbda1a7ed..81152a2df230dc57c5d9665771a4c5dbf9070ca3 100644 (file)
@@ -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;
                                }
 
index 453f3cb9c431890a6b4418d14fec25ac9d0624c9..dd8c00a6fbb51fbf59133d9c2276518f882ac30d 100644 (file)
@@ -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"]);
        }
index 1c33edf80ecdf6a62f6fc253ade0223dd68f557d..2cb72a60681b1a7d06973fe68dc12a66e433f32e 100644 (file)
@@ -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);
                }
        }
index 118ec81ca1c35e47ca966c997c254a2a379234d1..c2fa3bd19932a3a377dd4cc32f8d3ac0b71b9c76 100644 (file)
@@ -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;
 
index 812752a55c2ac2975834be4154de455d3c052cc7..37512ebd6a8be1af190265dbd6a408aa74f16731 100644 (file)
@@ -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();
 
index 399150f21cb8f8d763840a9dfdd74a98d5892b61..7aa34d45d7ef5cfbf05dd5862930ae8ec5b21ab6 100644 (file)
@@ -2,5 +2,5 @@
 require_once('include/diaspora.php');
 
 function profile_change() {
-       diaspora::send_profile(local_user());
+       Diaspora::send_profile(local_user());
 }
index ad7079e959ebce2d3a767167bb69e7a0ce693f2b..852315878dc675a1f5b1b4f6aabf1a86721d8f12 100644 (file)
@@ -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']);
index 5aea4eede967524f4b093dd04657aebadb985479..45243900c2dff96fcbe1a62f8054326f14a8865b 100644 (file)
@@ -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);
                        }
 
index 1c73ad37185234328952834fa042bc0f237a8aa3..753e286be75e5ba424154a78cdc835ed01f55b88 100644 (file)
@@ -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();
 }
index 170bed12a53d6055e3ac2aedb51acf4728744665..c8575a961eb3bb13f36b888bbfc85d2673697abf 100644 (file)
@@ -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;
index 8da044e9323916e742b2b1bb24404fefe854acdf..8d535145dcb10a4159c8c923732a90084ed640ac 100644 (file)
--- 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;
index 4991ac47e81811b473597398a4c129df2c00b330..571bac6def9579c0c774db17f4cad42704d83472 100644 (file)
@@ -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);
index 9f01ac59b08af0b0c4bd86fbfff7d6da7b9f62f2..e6a777d8d6811d12ca0ba576f560206205676e85 100644 (file)
@@ -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