- * big problems on shared hosting systems, where the process might get killed by the
- * hosting provider and nothing would get delivered.
+ * big problems on shared hosting systems, where the process might get killed by the
+ * hosting provider and nothing would get delivered.
* tag (in photos.php, poke.php, tagger.php)
* tgroup (in items.php)
* wall-new (in photos.php, item.php)
* tag (in photos.php, poke.php, tagger.php)
* tgroup (in items.php)
* wall-new (in photos.php, item.php)
require_once('include/items.php');
require_once('include/bbcode.php');
require_once('include/email.php');
require_once('include/items.php');
require_once('include/bbcode.php');
require_once('include/email.php');
require_once('include/Contact.php');
foreach($r as $contact) {
terminate_friendship($user, $self, $contact);
}
return;
require_once('include/Contact.php');
foreach($r as $contact) {
terminate_friendship($user, $self, $contact);
}
return;
- $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
- `user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
+ $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
+ `user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
// be notified during this run.
// Other DFRN conversation members will be alerted during polled updates.
// Diaspora members currently are not notified of expirations, and other networks have
// be notified during this run.
// Other DFRN conversation members will be alerted during polled updates.
// Diaspora members currently are not notified of expirations, and other networks have
$localhost = str_replace('www.','',$a->get_hostname());
if(strpos($localhost,':'))
$localhost = substr($localhost,0,strpos($localhost,':'));
/**
*
$localhost = str_replace('www.','',$a->get_hostname());
if(strpos($localhost,':'))
$localhost = substr($localhost,0,strpos($localhost,':'));
/**
*
- * Be VERY CAREFUL if you make any changes to the following several lines. Seemingly innocuous changes
- * have been known to cause runaway conditions which affected several servers, along with
- * permissions issues.
+ * Be VERY CAREFUL if you make any changes to the following several lines. Seemingly innocuous changes
+ * have been known to cause runaway conditions which affected several servers, along with
+ * permissions issues.
+ $recipients = array($parent['contact-id']);
+
+ if ($parent['network'] == NETWORK_OSTATUS) {
+
+ // Check if the recipient isn't in your contact list
+ $r = q("SELECT `url` FROM `contact` WHERE `id` = %d", $parent['contact-id']);
+ if (count($r)) {
+ $url_recipients = array();
+
+ $thrparent = q("SELECT `author-link` FROM `item` WHERE `uri` = '%s'", dbesc($target_item["thr-parent"]));
+ if (count($thrparent) AND (normalise_link($r[0]["url"]) != normalise_link($thrparent[0]["author-link"]))) {
+ require_once("include/Scrape.php");
+ $probed_contact = probe_url($thrparent[0]["author-link"]);
+ if ($probed_contact["notify"] != "") {
+ logger('scrape data for slapper: '.print_r($probed_contact, true));
+ $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
+ }
+ }
+ }
+ logger("url_recipients".print_r($url_recipients,true));
+ }
+ } else {
- if((strlen($parent['allow_cid']))
- || (strlen($parent['allow_gid']))
- || (strlen($parent['deny_cid']))
+ if((strlen($parent['allow_cid']))
+ || (strlen($parent['allow_gid']))
+ || (strlen($parent['deny_cid']))
set_config('system','site_prvkey', $res['prvkey']);
set_config('system','site_pubkey', $res['pubkey']);
}
set_config('system','site_prvkey', $res['prvkey']);
set_config('system','site_pubkey', $res['pubkey']);
}
$rp = q("SELECT `resource-id` , `scale`, type FROM `photo`
WHERE `profile` = 1 AND `uid` = %d ORDER BY scale;", $uid);
$photos = array();
$rp = q("SELECT `resource-id` , `scale`, type FROM `photo`
WHERE `profile` = 1 AND `uid` = %d ORDER BY scale;", $uid);
$photos = array();
-
- $atom .= replace_macros($sugg_template, array(
- '$name' => xmlify($owner['name']),
- '$photo' => xmlify($photos[4]),
- '$thumb' => xmlify($photos[5]),
- '$micro' => xmlify($photos[6]),
- '$url' => xmlify($owner['url']),
- '$request' => xmlify($owner['request']),
- '$confirm' => xmlify($owner['confirm']),
- '$notify' => xmlify($owner['notify']),
- '$poll' => xmlify($owner['poll']),
- '$sitepubkey' => xmlify(get_config('system','site_pubkey')),
- //'$pubkey' => xmlify($owner['pubkey']),
- //'$prvkey' => xmlify($owner['prvkey']),
- ));
- $recipients_relocate = q("SELECT * FROM contact WHERE uid = %d AND self = 0 AND network = '%s'" , intval($uid), NETWORK_DFRN);
+
+ $atom .= replace_macros($sugg_template, array(
+ '$name' => xmlify($owner['name']),
+ '$photo' => xmlify($photos[4]),
+ '$thumb' => xmlify($photos[5]),
+ '$micro' => xmlify($photos[6]),
+ '$url' => xmlify($owner['url']),
+ '$request' => xmlify($owner['request']),
+ '$confirm' => xmlify($owner['confirm']),
+ '$notify' => xmlify($owner['notify']),
+ '$poll' => xmlify($owner['poll']),
+ '$sitepubkey' => xmlify(get_config('system','site_pubkey')),
+ //'$pubkey' => xmlify($owner['pubkey']),
+ //'$prvkey' => xmlify($owner['prvkey']),
+ ));
+ $recipients_relocate = q("SELECT * FROM contact WHERE uid = %d AND self = 0 AND network = '%s'" , intval($uid), NETWORK_DFRN);
$atom .= atom_entry($item,'text',null,$owner,false);
}
}
$atom .= atom_entry($item,'text',null,$owner,false);
}
}
if($item_id == $item['id'] || $item['id'] == $item['parent'])
$atom .= atom_entry($item,'text',null,$owner,true);
if($item_id == $item['id'] || $item['id'] == $item['parent'])
$atom .= atom_entry($item,'text',null,$owner,true);
$atom .= atom_entry($item,'text',null,$owner,true);
$atom .= atom_entry($item,'text',null,$owner,true);
$slaps[] = atom_entry($item,'html',null,$owner,true);
}
}
$slaps[] = atom_entry($item,'html',null,$owner,true);
}
}
- if ($relocate)
- $r = $recipients_relocate;
- else
- $r = q("SELECT * FROM `contact` WHERE `id` IN ( %s ) AND `blocked` = 0 AND `pending` = 0 ",
- dbesc($recip_str)
- );
+ if ($relocate)
+ $r = $recipients_relocate;
+ else
+ $r = q("SELECT * FROM `contact` WHERE `id` IN ( %s ) AND `blocked` = 0 AND `pending` = 0 ",
+ dbesc($recip_str)
+ );
// This controls the number of deliveries to execute with each separate delivery process.
// By default we'll perform one delivery per process. Assuming a hostile shared hosting
// provider, this provides the greatest chance of deliveries if processes start getting
// This controls the number of deliveries to execute with each separate delivery process.
// By default we'll perform one delivery per process. Assuming a hostile shared hosting
// provider, this provides the greatest chance of deliveries if processes start getting
- // If $deliveries_per_process > 1, we will chain this number of multiple deliveries
- // together into a single process. This will reduce the overall number of processes
- // spawned for each delivery, but they will run longer.
+ // If $deliveries_per_process > 1, we will chain this number of multiple deliveries
+ // together into a single process. This will reduce the overall number of processes
+ // spawned for each delivery, but they will run longer.
- $x = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`,
- `contact`.`pubkey` AS `cpubkey`,
- `contact`.`prvkey` AS `cprvkey`,
- `contact`.`thumb` AS `thumb`,
+ $x = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`,
+ `contact`.`pubkey` AS `cpubkey`,
+ `contact`.`prvkey` AS `cprvkey`,
+ `contact`.`thumb` AS `thumb`,
`contact`.`url` as `url`,
`contact`.`name` as `senderName`,
`contact`.`url` as `url`,
`contact`.`name` as `senderName`,
WHERE `contact`.`blocked` = 0 AND `contact`.`archive` = 0
AND `contact`.`pending` = 0
AND `contact`.`network` = '%s' AND `user`.`nickname` = '%s'
WHERE `contact`.`blocked` = 0 AND `contact`.`archive` = 0
AND `contact`.`pending` = 0
AND `contact`.`network` = '%s' AND `user`.`nickname` = '%s'
// if contact's ssl policy changed, which we just determined
// is on our own server, update our contact links
// if contact's ssl policy changed, which we just determined
// is on our own server, update our contact links
$ssl_policy = get_config('system','ssl_policy');
fix_contact_ssl_policy($x[0],$ssl_policy);
$ssl_policy = get_config('system','ssl_policy');
fix_contact_ssl_policy($x[0],$ssl_policy);
require_once('library/simplepie/simplepie.inc');
logger('mod-delivery: local delivery');
local_delivery($x[0],$atom);
require_once('library/simplepie/simplepie.inc');
logger('mod-delivery: local delivery');
local_delivery($x[0],$atom);
logger('notifier: dfrndelivery: ' . $contact['name']);
$deliver_status = dfrn_deliver($owner,$contact,$atom);
logger('notifier: dfrn_delivery returns ' . $deliver_status);
logger('notifier: dfrndelivery: ' . $contact['name']);
$deliver_status = dfrn_deliver($owner,$contact,$atom);
logger('notifier: dfrn_delivery returns ' . $deliver_status);
if($deliver_status == (-1)) {
logger('notifier: delivery failed: queuing message');
// queue message for redelivery
if($deliver_status == (-1)) {
logger('notifier: delivery failed: queuing message');
// queue message for redelivery
// queue message for redelivery
add_to_queue($contact['id'],NETWORK_OSTATUS,$slap);
}
// queue message for redelivery
add_to_queue($contact['id'],NETWORK_OSTATUS,$slap);
}
- $headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
- if(!strlen($it['title'])) {
- $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1",
- dbesc($it['parent-uri']));
+ $headers .= "References: <".iri2msgid($it["parent-uri"]).">";
+
+ // If Threading is enabled, write down the correct parent
+ if (($it["thr-parent"] != "") and ($it["thr-parent"] != $it["parent-uri"]))
+ $headers .= " <".iri2msgid($it["thr-parent"]).">";
+ $headers .= "\n";
}
if(strncasecmp($subject,'RE:',3))
$subject = 'Re: '.$subject;
}
if(strncasecmp($subject,'RE:',3))
$subject = 'Re: '.$subject;
WHERE `network` in ( '%s', '%s') AND `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
AND `rel` != %d order by rand() ",
dbesc(NETWORK_DFRN),
WHERE `network` in ( '%s', '%s') AND `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
AND `rel` != %d order by rand() ",
dbesc(NETWORK_DFRN),
proc_run('php','include/delivery.php',$cmd,$item_id,$rr['id']);
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
proc_run('php','include/delivery.php',$cmd,$item_id,$rr['id']);
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
- $params = 'hub.mode=publish&hub.url=' . urlencode($a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
- post_url($h,$params);
- logger('pubsub: publish: ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
+
+ if ($h === '[internal]') {
+ // Set push flag for PuSH subscribers to this topic,
+ // they will be notified in queue.php
+ q("UPDATE `push_subscriber` SET `push` = 1 " .
+ "WHERE `nickname` = '%s'", dbesc($owner['nickname']));
+ } else {
+
+ $params = 'hub.mode=publish&hub.url=' . urlencode( $a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
+ post_url($h,$params);
+ logger('pubsub: publish: ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
+ }