diff options
author | Friendika <info@friendika.com> | 2011-02-11 03:17:16 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-02-11 03:17:16 -0800 |
commit | 0bfe63e7d887f484c5cc0aea37ead0c283967fee (patch) | |
tree | 76eaac6cbccd44e61d78946ef0517f97a734bc31 /include/notifier.php | |
parent | c16e86add81d9f2867a0da024954b5cbc14a9f4b (diff) | |
download | volse-hubzilla-0bfe63e7d887f484c5cc0aea37ead0c283967fee.tar.gz volse-hubzilla-0bfe63e7d887f484c5cc0aea37ead0c283967fee.tar.bz2 volse-hubzilla-0bfe63e7d887f484c5cc0aea37ead0c283967fee.zip |
reinstate send slaps but only at the top level (and followup)
Diffstat (limited to 'include/notifier.php')
-rw-r--r-- | include/notifier.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/include/notifier.php b/include/notifier.php index b6c4ca571..648a07062 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -40,6 +40,7 @@ function notifier_run($argv, $argc){ break; } + $top_level = false; $recipients = array(); $url_recipients = array(); @@ -79,12 +80,16 @@ function notifier_run($argv, $argc){ return; } + // avoid race condition with deleting entries if($items[0]['deleted']) { foreach($items as $item) $item['deleted'] = 1; } + + if(count($items) == 1 && $items[0]['uri'] === $items[0]['parent-uri']) + $top_level = true; } $r = q("SELECT `contact`.*, `user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`, `user`.`page-flags` @@ -167,9 +172,6 @@ function notifier_run($argv, $argc){ $r = q("SELECT * FROM `contact` WHERE `id` IN ( $conversant_str ) AND `blocked` = 0 AND `pending` = 0"); -// if( ! count($r)){ -// return; -// } if(count($r)) $contacts = $r; @@ -242,12 +244,8 @@ function notifier_run($argv, $argc){ $atom .= atom_entry($item,'text',$contact,$owner,true); - // There's a problem here - we *were* going to use salmon to provide semi-authenticated - // communication to OStatus, but unless we're the item author they won't verify. - // commented out for now, though we'll still send local replies (and any mentions - // that they contain) upstream. Rethinking the problem space. - -// $slaps[] = atom_entry($item,'html',$contact,$owner,true); + if(($top_level) && ($notify_hub) && ($item['author-link'] === $item['owner-link'])) + $slaps[] = atom_entry($item,'html',$contact,$owner,true); } } } @@ -255,7 +253,7 @@ function notifier_run($argv, $argc){ logger('notifier: ' . $atom, LOGGER_DATA); -// logger('notifier: slaps: ' . print_r($slaps,true), LOGGER_DATA); + logger('notifier: slaps: ' . print_r($slaps,true), LOGGER_DATA); if($followup) $recip_str = $parent['contact-id']; |