Some more function calls changed to the new class

This commit is contained in:
Michael Vogel 2016-03-14 08:11:14 +01:00
parent 75f5cfe63e
commit 9ae2b2292f
7 changed files with 19 additions and 13 deletions

View file

@ -129,7 +129,7 @@ function terminate_friendship($user,$self,$contact) {
} }
elseif($contact['network'] === NETWORK_DIASPORA) { elseif($contact['network'] === NETWORK_DIASPORA) {
require_once('include/diaspora.php'); require_once('include/diaspora.php');
diaspora_unshare($user,$contact); diaspora::send_unshare($user,$contact);
} }
elseif($contact['network'] === NETWORK_DFRN) { elseif($contact['network'] === NETWORK_DFRN) {
require_once('include/dfrn.php'); require_once('include/dfrn.php');

View file

@ -99,7 +99,7 @@ function network_to_name($s, $profile = "") {
$networkname = str_replace($search,$replace,$s); $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"); $networkname = t("Hubzilla/Redmatrix");
$r = q("SELECT `gserver`.`platform` FROM `gcontact` $r = q("SELECT `gserver`.`platform` FROM `gcontact`

View file

@ -522,25 +522,25 @@ function delivery_run(&$argv, &$argc){
if (($target_item['deleted']) && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) { if (($target_item['deleted']) && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) {
// top-level retraction // 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);
//diaspora_send_retraction($target_item,$owner,$contact,$public_message); //diaspora_send_retraction($target_item,$owner,$contact,$public_message);
break; break;
} elseif ($followup) { } elseif ($followup) {
// send comments and likes to owner to relay // 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);
//diaspora_send_followup($target_item,$owner,$contact,$public_message); //diaspora_send_followup($target_item,$owner,$contact,$public_message);
break; break;
} elseif ($target_item['uri'] !== $target_item['parent-uri']) { } elseif ($target_item['uri'] !== $target_item['parent-uri']) {
// we are the relay - send comments, likes and relayable_retractions to our conversants // 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);
//diaspora_send_relay($target_item,$owner,$contact,$public_message); //diaspora_send_relay($target_item,$owner,$contact,$public_message);
break; break;
} elseif ($top_level && !$walltowall) { } elseif ($top_level && !$walltowall) {
// currently no workable solution for sending 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);
//diaspora_send_status($target_item,$owner,$contact,$public_message); //diaspora_send_status($target_item,$owner,$contact,$public_message);
break; break;

View file

@ -460,6 +460,8 @@ class diaspora {
* @return string The public key * @return string The public key
*/ */
private function key($handle) { private function key($handle) {
$handle = strval($handle);
logger("Fetching diaspora key for: ".$handle); logger("Fetching diaspora key for: ".$handle);
$r = self::person_by_handle($handle); $r = self::person_by_handle($handle);
@ -1699,7 +1701,7 @@ class diaspora {
} }
// Check if the sender is the thread owner // 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"])); intval($r[0]["parent"]));
// Only delete it if the parent author really fits // Only delete it if the parent author really fits
@ -1716,7 +1718,7 @@ class diaspora {
); );
delete_thread($r[0]["id"], $r[0]["parent-uri"]); 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 // Now check if the retraction needs to be relayed by us
if($p[0]["origin"]) { if($p[0]["origin"]) {
@ -1727,6 +1729,8 @@ class diaspora {
intval($r[0]["id"]), intval($r[0]["id"]),
dbesc(json_encode($data)) 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 // notify others
proc_run("php", "include/notifier.php", "drop", $r[0]["id"]); proc_run("php", "include/notifier.php", "drop", $r[0]["id"]);
@ -2341,6 +2345,8 @@ class diaspora {
$type = "comment"; $type = "comment";
} }
logger("Got relayable data ".$type." for item ".$item["guid"]." (".$item["id"].")", LOGGER_DEBUG);
// fetch the original signature // fetch the original signature
$r = q("SELECT `signed_text`, `signature`, `signer` FROM `sign` WHERE `".$sql_sign_id."` = %d LIMIT 1", $r = q("SELECT `signed_text`, `signature`, `signer` FROM `sign` WHERE `".$sql_sign_id."` = %d LIMIT 1",

View file

@ -303,7 +303,7 @@ function new_contact($uid,$url,$interactive = false) {
} }
if($contact['network'] == NETWORK_DIASPORA) { if($contact['network'] == NETWORK_DIASPORA) {
require_once('include/diaspora.php'); 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); logger('mod_follow: diaspora_share returns: ' . $ret);
} }
} }

View file

@ -536,7 +536,7 @@ function notifier_run(&$argv, &$argc){
if($public_message) { if($public_message) {
if (!$followup AND $top_level) if (!$followup AND $top_level)
$r0 = diaspora_fetch_relay(); $r0 = diaspora::relay_list();
else else
$r0 = array(); $r0 = array();
@ -629,11 +629,11 @@ function notifier_run(&$argv, &$argc){
} }
// If the item was deleted, clean up the `sign` table // 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", $r = q("DELETE FROM sign where `retract_iid` = %d",
intval($target_item['id']) intval($target_item['id'])
); );
} } */
logger('notifier: calling hooks', LOGGER_DEBUG); logger('notifier: calling hooks', LOGGER_DEBUG);

View file

@ -193,7 +193,7 @@ function queue_run(&$argv, &$argc){
case NETWORK_DIASPORA: case NETWORK_DIASPORA:
if($contact['notify']) { if($contact['notify']) {
logger('queue: diaspora_delivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>'); 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)) { if($deliver_status == (-1)) {
update_queue_time($q_item['id']); update_queue_time($q_item['id']);