X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdelivery.php;h=7c5f4648c681fda5ca556b7877d67c2a16fb157c;hb=3b2cd854837e5df38f75f323aab24e31098812d4;hp=f95caed295f8bef2820cd8356675ee9fd913b53f;hpb=94f6f12ba3a5c1d506255803e709cb640147ebf4;p=friendica.git diff --git a/include/delivery.php b/include/delivery.php index f95caed295..7c5f4648c6 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -3,13 +3,13 @@ use Friendica\App; use Friendica\Core\System; use Friendica\Core\Config; +use Friendica\Database\DBM; +use Friendica\Protocol\Diaspora; +use Friendica\Protocol\DFRN; require_once 'include/queue_fn.php'; require_once 'include/html2plain.php'; -require_once 'include/probe.php'; -require_once 'include/diaspora.php'; require_once 'include/ostatus.php'; -require_once 'include/dfrn.php'; function delivery_run(&$argv, &$argc){ global $a; @@ -96,7 +96,7 @@ function delivery_run(&$argv, &$argc){ intval($item_id) ); - if ((!dbm::is_result($r)) || (!intval($r[0]['parent']))) { + if ((!DBM::is_result($r)) || (!intval($r[0]['parent']))) { continue; } @@ -156,7 +156,7 @@ function delivery_run(&$argv, &$argc){ intval($uid) ); - if (!dbm::is_result($r)) { + if (!DBM::is_result($r)) { continue; } @@ -227,7 +227,7 @@ function delivery_run(&$argv, &$argc){ intval($contact_id) ); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $contact = $r[0]; } if ($contact['self']) { @@ -244,12 +244,12 @@ function delivery_run(&$argv, &$argc){ if ($mail) { $item['body'] = fix_private_photos($item['body'],$owner['uid'],null,$message[0]['contact-id']); - $atom = dfrn::mail($item, $owner); + $atom = DFRN::mail($item, $owner); } elseif ($fsuggest) { - $atom = dfrn::fsuggest($item, $owner); + $atom = DFRN::fsuggest($item, $owner); q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id'])); } elseif ($relocate) { - $atom = dfrn::relocate($owner, $uid); + $atom = DFRN::relocate($owner, $uid); } elseif ($followup) { $msgitems = array(); foreach ($items as $item) { // there is only one item @@ -261,7 +261,7 @@ function delivery_run(&$argv, &$argc){ $msgitems[] = $item; } } - $atom = dfrn::entries($msgitems,$owner); + $atom = DFRN::entries($msgitems,$owner); } else { $msgitems = array(); foreach ($items as $item) { @@ -290,7 +290,7 @@ function delivery_run(&$argv, &$argc){ $msgitems[] = $item; } } - $atom = dfrn::entries($msgitems,$owner); + $atom = DFRN::entries($msgitems,$owner); } logger('notifier entry: '.$contact["url"].' '.$target_item["guid"].' entry: '.$atom, LOGGER_DEBUG); @@ -335,7 +335,7 @@ function delivery_run(&$argv, &$argc){ $x[0]['writable'] = 1; } - $ssl_policy = get_config('system','ssl_policy'); + $ssl_policy = Config::get('system','ssl_policy'); fix_contact_ssl_policy($x[0],$ssl_policy); // If we are setup as a soapbox we aren't accepting top level posts from this person @@ -344,13 +344,13 @@ function delivery_run(&$argv, &$argc){ break; } logger('mod-delivery: local delivery'); - dfrn::import($atom, $x[0]); + DFRN::import($atom, $x[0]); break; } } if (!was_recently_delayed($contact['id'])) { - $deliver_status = dfrn::deliver($owner,$contact,$atom); + $deliver_status = DFRN::deliver($owner,$contact,$atom); } else { $deliver_status = (-1); } @@ -375,7 +375,7 @@ function delivery_run(&$argv, &$argc){ if ($owner['prvnets']) { break; } - if (get_config('system','ostatus_disabled') || get_config('system','dfrn_only')) { + if (Config::get('system','ostatus_disabled') || Config::get('system','dfrn_only')) { break; } @@ -386,7 +386,7 @@ function delivery_run(&$argv, &$argc){ case NETWORK_MAIL: case NETWORK_MAIL2: - if (get_config('system','dfrn_only')) { + if (Config::get('system','dfrn_only')) { break; } // WARNING: does not currently convert to RFC2047 header encodings, etc. @@ -406,7 +406,7 @@ function delivery_run(&$argv, &$argc){ intval($argv[2]), intval($uid) ); - if (dbm::is_result($r)) + if (DBM::is_result($r)) $it = $r[0]; } if (!$it) @@ -463,14 +463,14 @@ function delivery_run(&$argv, &$argc){ dbesc($it['parent-uri']), intval($uid)); - if (dbm::is_result($r) && ($r[0]['title'] != '')) { + if (DBM::is_result($r) && ($r[0]['title'] != '')) { $subject = $r[0]['title']; } else { $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($it['parent-uri']), intval($uid)); - if (dbm::is_result($r) && ($r[0]['title'] != '')) + if (DBM::is_result($r) && ($r[0]['title'] != '')) $subject = $r[0]['title']; } } @@ -489,7 +489,7 @@ function delivery_run(&$argv, &$argc){ logger('delivery: diaspora batch deliver: '.$loc); - if (get_config('system','dfrn_only') || (!get_config('system','diaspora_enabled'))) + if (Config::get('system','dfrn_only') || (!Config::get('system','diaspora_enabled'))) break; if ($mail) { @@ -508,6 +508,9 @@ function delivery_run(&$argv, &$argc){ logger('diaspora retract: '.$loc); Diaspora::send_retraction($target_item,$owner,$contact,$public_message); break; + } elseif ($relocate) { + Diaspora::sendAccountMigration($owner, $contact, $uid); + break; } elseif ($followup) { // send comments and likes to owner to relay logger('diaspora followup: '.$loc);