aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Contact.php24
-rw-r--r--include/crypto.php2
-rw-r--r--include/delivery.php34
-rwxr-xr-xinclude/items.php1
-rw-r--r--include/notifier.php49
-rw-r--r--include/queue.php30
6 files changed, 14 insertions, 126 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 6b565f27c..fc0a6dd25 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -209,29 +209,7 @@ function terminate_friendship($user,$self,$contact) {
require_once('include/datetime.php');
- if($contact['network'] === NETWORK_OSTATUS) {
-
- $slap = replace_macros(get_markup_template('follow_slap.tpl'), array(
- '$name' => $user['username'],
- '$profile_page' => $a->get_baseurl() . '/profile/' . $user['nickname'],
- '$photo' => $self['photo'],
- '$thumb' => $self['thumb'],
- '$published' => datetime_convert('UTC','UTC', 'now', ATOM_TIME),
- '$item_id' => 'urn:X-dfrn:' . $a->get_hostname() . ':unfollow:' . random_string(),
- '$title' => '',
- '$type' => 'text',
- '$content' => t('stopped following'),
- '$nick' => $user['nickname'],
- '$verb' => 'http://ostatus.org/schema/1.0/unfollow', // ACTIVITY_UNFOLLOW,
- '$ostat_follow' => '' // '<as:verb>http://ostatus.org/schema/1.0/unfollow</as:verb>' . "\r\n"
- ));
-
- if((x($contact,'notify')) && (strlen($contact['notify']))) {
- require_once('include/salmon.php');
- slapper($user,$contact['notify'],$slap);
- }
- }
- elseif($contact['network'] === NETWORK_DFRN) {
+ if($contact['network'] === NETWORK_DFRN) {
require_once('include/items.php');
dfrn_deliver($user,$contact,'placeholder', 1);
}
diff --git a/include/crypto.php b/include/crypto.php
index f6ba2ed83..c5901f085 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -100,7 +100,6 @@ function metopem($m,$e) {
function pubrsatome($key,&$m,&$e) {
require_once('library/asn1.php');
- require_once('include/salmon.php');
$lines = explode("\n",$key);
unset($lines[0]);
@@ -125,7 +124,6 @@ function pemtorsa($key) {
}
function pemtome($key,&$m,&$e) {
- require_once('include/salmon.php');
$lines = explode("\n",$key);
unset($lines[0]);
unset($lines[count($lines)]);
diff --git a/include/delivery.php b/include/delivery.php
index 0d99f48a2..1c6b55164 100644
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -1,46 +1,28 @@
<?php
require_once("boot.php");
+require_once('include/cli_startup.php');
require_once('include/queue_fn.php');
require_once('include/html2plain.php');
function delivery_run($argv, $argc){
- global $a, $db;
- if(is_null($a)){
- $a = new App;
- }
-
- if(is_null($db)) {
- @include(".htconfig.php");
- require_once("dba.php");
- $db = new dba($db_host, $db_user, $db_pass, $db_data);
- unset($db_host, $db_user, $db_pass, $db_data);
- }
+ cli_startup();
+ global $a;
- require_once("session.php");
- require_once("datetime.php");
require_once('include/items.php');
require_once('include/bbcode.php');
- require_once('include/email.php');
- load_config('config');
- load_config('system');
-
- load_hooks();
-
- if($argc < 3)
+ if(argc() < 3)
return;
- $a->set_baseurl(get_config('system','url'));
-
logger('delivery: invoked: ' . print_r($argv,true), LOGGER_DEBUG);
- $cmd = $argv[1];
- $item_id = intval($argv[2]);
+ $cmd = argv(1);
+ $item_id = intval(argv(2));
- for($x = 3; $x < $argc; $x ++) {
+ for($x = 3; $x < argc(); $x ++) {
- $contact_id = intval($argv[$x]);
+ $contact_id = intval(argv($x));
// Some other process may have delivered this item already.
diff --git a/include/items.php b/include/items.php
index 02bfed7cc..91320ff4e 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2,7 +2,6 @@
require_once('include/bbcode.php');
require_once('include/oembed.php');
-require_once('include/salmon.php');
require_once('include/crypto.php');
require_once('include/Photo.php');
diff --git a/include/notifier.php b/include/notifier.php
index 15ab67b7b..e997861f3 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -449,8 +449,6 @@ function notifier_run($argv, $argc){
);
- require_once('include/salmon.php');
-
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
// delivery loop
@@ -583,39 +581,6 @@ function notifier_run($argv, $argc){
add_to_queue($contact['id'],NETWORK_DFRN,$atom);
}
break;
- case NETWORK_OSTATUS:
-
- if(get_config('system','ostatus_disabled') || get_config('system','dfrn_only'))
- break;
-
- if($followup && $contact['notify']) {
- logger('notifier: slapdelivery: ' . $contact['name']);
- $deliver_status = slapper($owner,$contact['notify'],$slap);
-
- if($deliver_status == (-1)) {
- // queue message for redelivery
- add_to_queue($contact['id'],NETWORK_OSTATUS,$slap);
- }
- }
- else {
-
- // only send salmon if public - e.g. if it's ok to notify
- // a public hub, it's ok to send a salmon
-
- if((count($slaps)) && ($public_message) && (! $expire)) {
- logger('notifier: slapdelivery: ' . $contact['name']);
- foreach($slaps as $slappy) {
- if($contact['notify']) {
- $deliver_status = slapper($owner,$contact['notify'],$slappy);
- if($deliver_status == (-1)) {
- // queue message for redelivery
- add_to_queue($contact['id'],NETWORK_OSTATUS,$slappy);
- }
- }
- }
- }
- }
- break;
default:
break;
@@ -623,20 +588,6 @@ function notifier_run($argv, $argc){
}
}
- // send additional slaps to mentioned remote tags (@foo@example.com)
-
- if($slap && count($url_recipients) && ($followup || $top_level) && $public_message && (! $expire)) {
- if(! get_config('system','dfrn_only')) {
- foreach($url_recipients as $url) {
- if($url) {
- logger('notifier: urldelivery: ' . $url);
- $deliver_status = slapper($owner,$url,$slap);
- // TODO: redeliver/queue these items on failure, though there is no contact record
- }
- }
- }
- }
-
if($public_message) {
diff --git a/include/queue.php b/include/queue.php
index 0bd12762f..a45d3ed63 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -1,36 +1,18 @@
<?php
require_once("boot.php");
+require_once('include/cli_startup.php');
require_once('include/queue_fn.php');
function queue_run($argv, $argc){
- global $a, $db;
-
- if(is_null($a)){
- $a = new App;
- }
-
- if(is_null($db)){
- @include(".htconfig.php");
- require_once("dba.php");
- $db = new dba($db_host, $db_user, $db_pass, $db_data);
- unset($db_host, $db_user, $db_pass, $db_data);
- };
+ cli_startup();
+ global $a;
- require_once("session.php");
- require_once("datetime.php");
require_once('include/items.php');
require_once('include/bbcode.php');
- load_config('config');
- load_config('system');
-
- $a->set_baseurl(get_config('system','url'));
-
- load_hooks();
-
- if($argc > 1)
- $queue_id = intval($argv[1]);
+ if(argc() > 1)
+ $queue_id = intval(argv(1));
else
$queue_id = 0;
@@ -83,8 +65,6 @@ function queue_run($argv, $argc){
// delivery loop
- require_once('include/salmon.php');
-
foreach($r as $q_item) {
// queue_predeliver hooks may have changed the queue db details,