From 52557b011d2c05e83b1df91d2d766317dd2c5223 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 29 Sep 2011 21:56:44 -0700 Subject: possible sql errors --- include/notifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/notifier.php') diff --git a/include/notifier.php b/include/notifier.php index 748d15743..864fa517b 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; -- cgit v1.2.3 From 7c1968907d26a66581d362475a6b557e53e159cb Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 2 Oct 2011 05:32:05 -0700 Subject: attack of the zombie orphans --- include/notifier.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/notifier.php') diff --git a/include/notifier.php b/include/notifier.php index 864fa517b..d1cd1cc73 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -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) -- cgit v1.2.3 From 7b648e6da85ece5b402dfce6d546f5711bc63bea Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 18:53:56 -0700 Subject: performance enhancements --- include/notifier.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/notifier.php') diff --git a/include/notifier.php b/include/notifier.php index d1cd1cc73..ceeea2368 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -360,7 +360,12 @@ function notifier_run($argv, $argc){ if(! $contact) continue; - $atom .= atom_entry($item,'text',$contact,$owner,true); + if($normal_mode) { + if($item_id == $item['id']) + $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); -- cgit v1.2.3 From ab5052197137b1fbf069f3791c75d6163c569bc0 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 22:00:45 -0700 Subject: yikes --- include/notifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/notifier.php') diff --git a/include/notifier.php b/include/notifier.php index ceeea2368..ccac5106f 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -361,7 +361,7 @@ function notifier_run($argv, $argc){ continue; if($normal_mode) { - if($item_id == $item['id']) + if($item_id == $item['id'] || $item['id'] == $item['parent']) $atom .= atom_entry($item,'text',$contact,$owner,true); } else -- cgit v1.2.3 From 6c521017f5e58432d0eaadb90d0745fe7c4f1472 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Oct 2011 22:03:57 -0700 Subject: document backward compat issue --- include/notifier.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/notifier.php') diff --git a/include/notifier.php b/include/notifier.php index ccac5106f..c3f7f33ea 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -361,6 +361,10 @@ function notifier_run($argv, $argc){ continue; 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); } -- cgit v1.2.3