aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 748d15743..c3f7f33ea 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -86,7 +86,7 @@ function notifier_run($argv, $argc){
$normal_mode = false;
$expire = true;
$items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1
- AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP - INTERVAL 10 MINUTE",
+ AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP() - INTERVAL 10 MINUTE",
intval($item_id)
);
$uid = $item_id;
@@ -123,6 +123,9 @@ function notifier_run($argv, $argc){
$uid = $r[0]['uid'];
$updated = $r[0]['edited'];
+ if(! $parent_id)
+ return;
+
$items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer`
FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d ORDER BY `id` ASC",
intval($parent_id)
@@ -357,7 +360,16 @@ function notifier_run($argv, $argc){
if(! $contact)
continue;
- $atom .= atom_entry($item,'text',$contact,$owner,true);
+ if($normal_mode) {
+
+ // we only need the current item, but include the parent because without it
+ // older sites without a corresponding dfrn_notify change may do the wrong thing.
+
+ if($item_id == $item['id'] || $item['id'] == $item['parent'])
+ $atom .= atom_entry($item,'text',$contact,$owner,true);
+ }
+ else
+ $atom .= atom_entry($item,'text',$contact,$owner,true);
if(($top_level) && ($public_message) && ($item['author-link'] === $item['owner-link']) && (! $expire))
$slaps[] = atom_entry($item,'html',$contact,$owner,true);