aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/notifier.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/notifier.php b/include/notifier.php
index e67ef06e3..89b0964b4 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -15,17 +15,29 @@ require_once("datetime.php");
// FIXME - generalise for other content, probably create a notify queue in
// the db with type and recipient list
-if(($argc != 3) || (! intval($argv[2])))
+if($argc < 3)
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;
$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`
WHERE `item`.`id` = %d LIMIT 1",
intval($item_id)