Browse Source

Some more function calls changed to the new class

pull/3010/head
Michael Vogel 5 years ago
committed by Roland Haeder
parent
commit
3e79a19e57
No known key found for this signature in database GPG Key ID: B72F8185C6C7BD78
7 changed files with 19 additions and 13 deletions
  1. +1
    -1
      include/Contact.php
  2. +1
    -1
      include/contact_selectors.php
  3. +4
    -4
      include/delivery.php
  4. +8
    -2
      include/diaspora2.php
  5. +1
    -1
      include/follow.php
  6. +3
    -3
      include/notifier.php
  7. +1
    -1
      include/queue.php

+ 1
- 1
include/Contact.php View 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');


+ 1
- 1
include/contact_selectors.php View 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`


+ 4
- 4
include/delivery.php View 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;


+ 8
- 2
include/diaspora2.php View 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",


+ 1
- 1
include/follow.php View 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);
}
}


+ 3
- 3
include/notifier.php View 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);


+ 1
- 1
include/queue.php View 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']);


Loading…
Cancel
Save