more work

This commit is contained in:
Mike Macgirvin 2010-07-08 17:49:41 -07:00
parent d81365c123
commit bec3d15c52
4 changed files with 25 additions and 8 deletions

View file

@ -15,17 +15,29 @@ require_once("datetime.php");
// FIXME - generalise for other content, probably create a notify queue in // FIXME - generalise for other content, probably create a notify queue in
// the db with type and recipient list // the db with type and recipient list
if(($argc != 3) || (! intval($argv[2]))) if($argc < 3)
exit; exit;
$baseurl = trim(pack("H*" , $argv[1])); $baseurl = trim(hex2bin($argv[1]));
$cmd = $argv[2];
switch($cmd) {
default:
$item_id = intval($argv[3]);
if(! $item_id)
killme();
break;
}
$item_id = $argv[2];
$is_parent = false; $is_parent = false;
$recipients = array(); $recipients = array();
// fetch requested item
$r = q("SELECT `item`.*, `contact`.*,`item`.`id` AS `item_id` FROM `item` LEFT JOIN `contact` ON `item`.`contact-id` = `contact`.`id` $r = q("SELECT `item`.*, `contact`.*,`item`.`id` AS `item_id` FROM `item` LEFT JOIN `contact` ON `item`.`contact-id` = `contact`.`id`
WHERE `item`.`id` = %d LIMIT 1", WHERE `item`.`id` = %d LIMIT 1",
intval($item_id) intval($item_id)

View file

@ -24,6 +24,9 @@ function item_post(&$a) {
if(count($r)) if(count($r))
$contact_id = $r[0]['id']; $contact_id = $r[0]['id'];
} }
$notify_type = (($parent) ? 'comment-new' : 'wall-new' );
if($_POST['type'] == 'jot') { if($_POST['type'] == 'jot') {
do { do {
@ -59,10 +62,9 @@ function item_post(&$a) {
} }
$url = bin2hex($a->get_baseurl()); $url = bin2hex($a->get_baseurl());
proc_close(proc_open("php include/notifier.php $url $post_id > notify.log &",
array(),$foo));
// notifier($a,$post_id,$parent); proc_close(proc_open("php include/notifier.php $url $notify_type $post_id > notify.log &",
array(),$foo));
} }
goaway($a->get_baseurl() . "/profile/$profile_uid"); goaway($a->get_baseurl() . "/profile/$profile_uid");

View file

@ -4,5 +4,5 @@
function login_content(&$a) { function login_content(&$a) {
// return login($a->config['register_enabled']); // return login($a->config['register_enabled']);
return login(1); return login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
} }

View file

@ -1,5 +1,8 @@
<feed xmlns="http://www.w3.org/2005/Atom" <feed xmlns="http://www.w3.org/2005/Atom"
xmlns:foaf="http://xmlns.com/foaf/0.1" > xmlns:foaf="http://xmlns.com/foaf/0.1"
xmlns:thr="http://purl.org/syndication/thread/1.0"
xmlns:at="http://purl.org/atompub/tombstones/1.0"
>
<id>$feed_id</id> <id>$feed_id</id>
<title>$feed_title</title> <title>$feed_title</title>
<updated>$feed_updated</updated> <updated>$feed_updated</updated>