aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/notifier.php12
-rw-r--r--include/zot.php4
2 files changed, 12 insertions, 4 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 6a70bd738..b4ccf69cc 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -168,15 +168,16 @@ function notifier_run($argv, $argc){
// Normal items
// Fetch the target item
-
+dbg(1);
$r = q("SELECT * FROM item WHERE id = %d and parent != 0 LIMIT 1",
intval($item_id)
);
if(! $r)
return;
-
+logger('notify1');
xchan_query($r);
+dbg(0);
$r = fetch_post_tags($r);
$target_item = $r[0];
@@ -187,6 +188,7 @@ function notifier_run($argv, $argc){
if($s)
$channel = $s[0];
+logger('notify2');
if($target_item['id'] == $target_item['parent']) {
$parent_item = $target_item;
$top_level_post = true;
@@ -194,8 +196,11 @@ function notifier_run($argv, $argc){
else {
// fetch the parent item
$r = q("SELECT * from item where id = %d order by id asc",
- intval($parent_id)
+ intval($target_item['parent'])
);
+
+logger('notify3');
+
if(! $r)
return;
xchan_query($r);
@@ -204,6 +209,7 @@ function notifier_run($argv, $argc){
$parent_item = $r[0];
$top_level_post = false;
}
+logger('notify4');
$encoded_item = encode_item($target_item);
diff --git a/include/zot.php b/include/zot.php
index aceee5f71..654b17353 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -108,10 +108,12 @@ function zot_build_packet($channel,$type = 'notify',$recipients = null, $remote_
if($secret)
$data['secret'] = $secret;
+ logger('zot_build_packet: ' . print_r($data,true));
+
// Hush-hush ultra top-secret mode
if($remote_key) {
- $data = aes_encapsulate($data,$remote_key);
+ $data = aes_encapsulate(json_encode($data),$remote_key);
}
return json_encode($data);