}
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');
$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`
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;
* @return string The public key
*/
private function key($handle) {
+ $handle = strval($handle);
+
logger("Fetching diaspora key for: ".$handle);
$r = self::person_by_handle($handle);
}
// 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
);
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"]) {
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"]);
$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",
}
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);
}
}
if($public_message) {
if (!$followup AND $top_level)
- $r0 = diaspora_fetch_relay();
+ $r0 = diaspora::relay_list();
else
$r0 = array();
}
// 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);
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']);