]> git.mxchange.org Git - friendica.git/commitdiff
Some more function calls changed to the new class
authorMichael Vogel <icarus@dabo.de>
Mon, 14 Mar 2016 07:11:14 +0000 (08:11 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 14 Mar 2016 07:11:14 +0000 (08:11 +0100)
include/Contact.php
include/contact_selectors.php
include/delivery.php
include/diaspora2.php
include/follow.php
include/notifier.php
include/queue.php

index 3799e0b189a98830aec305d5da37d2122f7310f8..d76c8f826cd68846f59f30a6ffd9c2bfdfb51c70 100644 (file)
@@ -129,7 +129,7 @@ function terminate_friendship($user,$self,$contact) {
        }
        elseif($contact['network'] === NETWORK_DIASPORA) {
                require_once('include/diaspora.php');
-               diaspora_unshare($user,$contact);
+               diaspora::send_unshare($user,$contact);
        }
        elseif($contact['network'] === NETWORK_DFRN) {
                require_once('include/dfrn.php');
index a884a6b52be7ebcc834a4fc7b761ad49e5344787..3bf68f764e5597abdfd72fac05c91d1e371fd178 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 d184fe12e1758cef5f904a19b070060d1a37740b..1e1dadcd934e3ca0e01be582a88279ff4e9ce9d3 100644 (file)
@@ -522,25 +522,25 @@ function delivery_run(&$argv, &$argc){
 
                                if (($target_item['deleted']) && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) {
                                        // top-level retraction
-                                       logger('delivery: diaspora retract: '.$loc);
-
+                                       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('delivery: diaspora relay: '.$loc);
+                                       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('delivery: diaspora status: '.$loc);
+                                       logger('diaspora status: '.$loc);
                                        diaspora::send_status($target_item,$owner,$contact,$public_message);
                                        //diaspora_send_status($target_item,$owner,$contact,$public_message);
                                        break;
index f6b8b9a704165e976f9d05a8a97c22ca06ec0f0c..5c17754e80b13c13399e4936e0be94899495575b 100644 (file)
@@ -460,6 +460,8 @@ class diaspora {
         * @return string The public key
         */
        private function key($handle) {
+               $handle = strval($handle);
+
                logger("Fetching diaspora key for: ".$handle);
 
                $r = self::person_by_handle($handle);
@@ -1699,7 +1701,7 @@ class diaspora {
                }
 
                // Check if the sender is the thread owner
-               $p = q("SELECT `author-link`, `origin` FROM `item` WHERE `id` = %d",
+               $p = q("SELECT `id`, `author-link`, `origin` FROM `item` WHERE `id` = %d",
                        intval($r[0]["parent"]));
 
                // Only delete it if the parent author really fits
@@ -1716,7 +1718,7 @@ class diaspora {
                );
                delete_thread($r[0]["id"], $r[0]["parent-uri"]);
 
-               logger("Deleted target ".$target_guid." from user ".$importer["uid"], LOGGER_DEBUG);
+               logger("Deleted target ".$target_guid." (".$r[0]["id"].") from user ".$importer["uid"]." parent: ".$p[0]["id"], LOGGER_DEBUG);
 
                // Now check if the retraction needs to be relayed by us
                if($p[0]["origin"]) {
@@ -1727,6 +1729,8 @@ class diaspora {
                                intval($r[0]["id"]),
                                dbesc(json_encode($data))
                        );
+                       $s = q("select * from sign where retract_iid = %d", intval($r[0]["id"]));
+                       logger("Stored signatur for item ".$r[0]["id"]." - ".print_r($s, true), LOGGER_DEBUG);
 
                        // notify others
                        proc_run("php", "include/notifier.php", "drop", $r[0]["id"]);
@@ -2341,6 +2345,8 @@ class diaspora {
                        $type = "comment";
                }
 
+               logger("Got relayable data ".$type." for item ".$item["guid"]." (".$item["id"].")", LOGGER_DEBUG);
+
                // fetch the original signature
 
                $r = q("SELECT `signed_text`, `signature`, `signer` FROM `sign` WHERE `".$sql_sign_id."` = %d LIMIT 1",
index 3af629536d61216d61c4fcc897c53e6872539585..6eab7e12fa677a7bf7b6c627fa35f86a84fa3bf9 100644 (file)
@@ -303,7 +303,7 @@ function new_contact($uid,$url,$interactive = false) {
                }
                if($contact['network'] == NETWORK_DIASPORA) {
                        require_once('include/diaspora.php');
-                       $ret = diaspora_share($a->user,$contact);
+                       $ret = diaspora::send_share($a->user,$contact);
                        logger('mod_follow: diaspora_share returns: ' . $ret);
                }
        }
index 6c42f19c6aec66c22d0f2522b15f13a8382b7ea8..e65da3adf2cbff2fc5d9ad32af4d5a0d091fdfd6 100644 (file)
@@ -536,7 +536,7 @@ function notifier_run(&$argv, &$argc){
        if($public_message) {
 
                if (!$followup AND $top_level)
-                       $r0 = diaspora_fetch_relay();
+                       $r0 = diaspora::relay_list();
                else
                        $r0 = array();
 
@@ -629,11 +629,11 @@ function notifier_run(&$argv, &$argc){
        }
 
        // If the item was deleted, clean up the `sign` table
-       if($target_item['deleted']) {
+       /* if($target_item['deleted']) {
                $r = q("DELETE FROM sign where `retract_iid` = %d",
                        intval($target_item['id'])
                );
-       }
+       } */
 
        logger('notifier: calling hooks', LOGGER_DEBUG);
 
index 183ce0f9cd610ff80789e86c6cfc81a91f2a32b4..878c149731d7b1a8c443f052efda6bdbde4d216b 100644 (file)
@@ -193,7 +193,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']);