more cleanup
This commit is contained in:
parent
672da80282
commit
7acba41dc6
@ -209,29 +209,7 @@ function terminate_friendship($user,$self,$contact) {
|
|||||||
|
|
||||||
require_once('include/datetime.php');
|
require_once('include/datetime.php');
|
||||||
|
|
||||||
if($contact['network'] === NETWORK_OSTATUS) {
|
if($contact['network'] === NETWORK_DFRN) {
|
||||||
|
|
||||||
$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) {
|
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
dfrn_deliver($user,$contact,'placeholder', 1);
|
dfrn_deliver($user,$contact,'placeholder', 1);
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,6 @@ function metopem($m,$e) {
|
|||||||
|
|
||||||
function pubrsatome($key,&$m,&$e) {
|
function pubrsatome($key,&$m,&$e) {
|
||||||
require_once('library/asn1.php');
|
require_once('library/asn1.php');
|
||||||
require_once('include/salmon.php');
|
|
||||||
|
|
||||||
$lines = explode("\n",$key);
|
$lines = explode("\n",$key);
|
||||||
unset($lines[0]);
|
unset($lines[0]);
|
||||||
@ -125,7 +124,6 @@ function pemtorsa($key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pemtome($key,&$m,&$e) {
|
function pemtome($key,&$m,&$e) {
|
||||||
require_once('include/salmon.php');
|
|
||||||
$lines = explode("\n",$key);
|
$lines = explode("\n",$key);
|
||||||
unset($lines[0]);
|
unset($lines[0]);
|
||||||
unset($lines[count($lines)]);
|
unset($lines[count($lines)]);
|
||||||
|
@ -1,46 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
|
require_once('include/cli_startup.php');
|
||||||
require_once('include/queue_fn.php');
|
require_once('include/queue_fn.php');
|
||||||
require_once('include/html2plain.php');
|
require_once('include/html2plain.php');
|
||||||
|
|
||||||
function delivery_run($argv, $argc){
|
function delivery_run($argv, $argc){
|
||||||
global $a, $db;
|
|
||||||
|
|
||||||
if(is_null($a)){
|
cli_startup();
|
||||||
$a = new App;
|
global $a;
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once("session.php");
|
|
||||||
require_once("datetime.php");
|
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/email.php');
|
|
||||||
|
|
||||||
load_config('config');
|
if(argc() < 3)
|
||||||
load_config('system');
|
|
||||||
|
|
||||||
load_hooks();
|
|
||||||
|
|
||||||
if($argc < 3)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$a->set_baseurl(get_config('system','url'));
|
|
||||||
|
|
||||||
logger('delivery: invoked: ' . print_r($argv,true), LOGGER_DEBUG);
|
logger('delivery: invoked: ' . print_r($argv,true), LOGGER_DEBUG);
|
||||||
|
|
||||||
$cmd = $argv[1];
|
$cmd = argv(1);
|
||||||
$item_id = intval($argv[2]);
|
$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.
|
// Some other process may have delivered this item already.
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/oembed.php');
|
require_once('include/oembed.php');
|
||||||
require_once('include/salmon.php');
|
|
||||||
require_once('include/crypto.php');
|
require_once('include/crypto.php');
|
||||||
require_once('include/Photo.php');
|
require_once('include/Photo.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')));
|
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
|
||||||
|
|
||||||
// delivery loop
|
// delivery loop
|
||||||
@ -583,39 +581,6 @@ function notifier_run($argv, $argc){
|
|||||||
add_to_queue($contact['id'],NETWORK_DFRN,$atom);
|
add_to_queue($contact['id'],NETWORK_DFRN,$atom);
|
||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
break;
|
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) {
|
if($public_message) {
|
||||||
|
|
||||||
|
@ -1,36 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
|
require_once('include/cli_startup.php');
|
||||||
require_once('include/queue_fn.php');
|
require_once('include/queue_fn.php');
|
||||||
|
|
||||||
function queue_run($argv, $argc){
|
function queue_run($argv, $argc){
|
||||||
global $a, $db;
|
|
||||||
|
|
||||||
if(is_null($a)){
|
cli_startup();
|
||||||
$a = new App;
|
global $a;
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
require_once("session.php");
|
|
||||||
require_once("datetime.php");
|
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
|
|
||||||
load_config('config');
|
if(argc() > 1)
|
||||||
load_config('system');
|
$queue_id = intval(argv(1));
|
||||||
|
|
||||||
$a->set_baseurl(get_config('system','url'));
|
|
||||||
|
|
||||||
load_hooks();
|
|
||||||
|
|
||||||
if($argc > 1)
|
|
||||||
$queue_id = intval($argv[1]);
|
|
||||||
else
|
else
|
||||||
$queue_id = 0;
|
$queue_id = 0;
|
||||||
|
|
||||||
@ -83,8 +65,6 @@ function queue_run($argv, $argc){
|
|||||||
|
|
||||||
// delivery loop
|
// delivery loop
|
||||||
|
|
||||||
require_once('include/salmon.php');
|
|
||||||
|
|
||||||
foreach($r as $q_item) {
|
foreach($r as $q_item) {
|
||||||
|
|
||||||
// queue_predeliver hooks may have changed the queue db details,
|
// queue_predeliver hooks may have changed the queue db details,
|
||||||
|
Reference in New Issue
Block a user