diff options
author | zotlabs <mike@macgirvin.com> | 2017-09-13 19:20:16 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-09-13 19:20:16 -0700 |
commit | 13788af90838d66b1c701f935862a37fcc7262f4 (patch) | |
tree | 0fb773c378f1314d379dcc3763d50e5a87fac21b /Zotlabs | |
parent | 0e6d84e20731f173e489fe0d54b43c01266c0391 (diff) | |
download | volse-hubzilla-13788af90838d66b1c701f935862a37fcc7262f4.tar.gz volse-hubzilla-13788af90838d66b1c701f935862a37fcc7262f4.tar.bz2 volse-hubzilla-13788af90838d66b1c701f935862a37fcc7262f4.zip |
Zot6: some things that need to be done ahead of time so we can turbocharge the delivery engine and split off site records from channel records.
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Daemon/Deliver.php | 31 | ||||
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 2 |
2 files changed, 20 insertions, 13 deletions
diff --git a/Zotlabs/Daemon/Deliver.php b/Zotlabs/Daemon/Deliver.php index dbc311cf5..7c1ff717f 100644 --- a/Zotlabs/Daemon/Deliver.php +++ b/Zotlabs/Daemon/Deliver.php @@ -53,22 +53,29 @@ class Deliver { remove_queue_item($r[0]['outq_hash']); if($dresult && is_array($dresult)) { - foreach($dresult as $xx) { - if(is_array($xx) && array_key_exists('message_id',$xx)) { - if(delivery_report_is_storable($xx)) { - q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ", - dbesc($xx['message_id']), - dbesc($xx['location']), - dbesc($xx['recipient']), - dbesc($xx['status']), - dbesc(datetime_convert($xx['date'])), - dbesc($xx['sender']) - ); + if(array_key_exists('iv',$dresult)) { + $dresult = json_decode(crypto_unencapsulate($dresult,get_config('system','prvkey')),true); + } + if(! $dresult) { + logger('dreport decryption failure'); + } + else { + foreach($dresult as $xx) { + if(is_array($xx) && array_key_exists('message_id',$xx)) { + if(delivery_report_is_storable($xx)) { + q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ", + dbesc($xx['message_id']), + dbesc($xx['location']), + dbesc($xx['recipient']), + dbesc($xx['status']), + dbesc(datetime_convert($xx['date'])), + dbesc($xx['sender']) + ); + } } } } } - q("delete from dreport where dreport_queue = '%s'", dbesc($argv[$x]) ); diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index e8cd4dac8..0e8c99572 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -492,7 +492,7 @@ class Notifier { // Now we have collected recipients (except for external mentions, FIXME) // Let's reduce this to a set of hubs; checking that the site is not dead. - $r = q("select hubloc.*, site.site_crypto from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . implode(',',$recipients) . ") + $r = q("select hubloc.*, site.site_crypto, site.site_flags from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . implode(',',$recipients) . ") and hubloc_error = 0 and hubloc_deleted = 0 and ( site_dead = 0 OR site_dead is null ) " ); |