diff options
author | friendica <info@friendica.com> | 2012-11-18 19:19:16 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-11-18 19:19:16 -0800 |
commit | db77309bc399669c5c98f4fac99f2d5f96cfbaeb (patch) | |
tree | 0c36049a0014afcc89d6b30a4a0a556d896afa61 /include/notifier.php | |
parent | 8611c3da683b9d3aa742559c192b0f9237256431 (diff) | |
download | volse-hubzilla-db77309bc399669c5c98f4fac99f2d5f96cfbaeb.tar.gz volse-hubzilla-db77309bc399669c5c98f4fac99f2d5f96cfbaeb.tar.bz2 volse-hubzilla-db77309bc399669c5c98f4fac99f2d5f96cfbaeb.zip |
For private messages, use hush-hush ultra top-secret mode by default
Diffstat (limited to 'include/notifier.php')
-rw-r--r-- | include/notifier.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/notifier.php b/include/notifier.php index cff504d09..f620af10a 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -209,17 +209,18 @@ function notifier_run($argv, $argc){ if($relay_to_owner) { logger('notifier: followup relay', LOGGER_DEBUG); $recipients = array($parent_item['owner_xchan']); + $private = true; if(! $encoded_item['flags']) $encoded_item['flags'] = array(); $encoded_item['flags'][] = 'relay'; } else { logger('notifier: normal distribution', LOGGER_DEBUG); - $recipients = collect_recipients($parent_item); + $private = false; + $recipients = collect_recipients($parent_item,$private); // FIXME add any additional recipients such as mentions, etc. - // don't send deletions onward for other people's stuff // TODO verify this is needed - copied logic from same place in old code @@ -227,8 +228,6 @@ function notifier_run($argv, $argc){ logger('notifier: ignoring delete notification for non-wall item'); return; } - - } logger('notifier: encoded item: ' . print_r($encoded_item,true)); @@ -238,6 +237,9 @@ function notifier_run($argv, $argc){ return; logger('notifier: recipients: ' . print_r($recipients,true)); + // Now we have collected recipients (except for external mentions, FIXME) + // Let's reduce this to a set of hubs. + $r = q("select distinct(hubloc_callback),hubloc_host,hubloc_sitekey from hubloc where hubloc_hash in (" . implode(',',$recipients) . ") group by hubloc_callback"); if(! $r) { @@ -245,8 +247,6 @@ function notifier_run($argv, $argc){ return; } $hubs = $r; - if(! $hubs) - return; $interval = ((get_config('system','delivery_interval') !== false) ? intval(get_config('system','delivery_interval')) : 2 ); @@ -260,8 +260,8 @@ function notifier_run($argv, $argc){ $current_count = 0; foreach($hubs as $hub) { - $n = zot_build_packet($channel,'notify',null,null); $hash = random_string(); + $n = zot_build_packet($channel,'notify',null,(($private) ? $hub['hubloc_sitekey'],$hash); q("insert into outq ( outq_hash, outq_account, outq_channel, outq_posturl, outq_created, outq_updated, outq_notify, outq_msg ) values ( '%s', %d, %d, '%s', '%s', '%s', '%s', '%s' )", dbesc($hash), intval($target_item['aid']), |