aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-21 22:30:28 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-21 22:30:28 -0700
commit146ff6f70308647b27374a1bba386c156498bd2e (patch)
treee2a7e853ab0f0102f86fd53cfb7c8146f530cfad /include/zot.php
parent326ae5ff6b91463eaec262a131dbd44e2c2ccf6e (diff)
downloadvolse-hubzilla-146ff6f70308647b27374a1bba386c156498bd2e.tar.gz
volse-hubzilla-146ff6f70308647b27374a1bba386c156498bd2e.tar.bz2
volse-hubzilla-146ff6f70308647b27374a1bba386c156498bd2e.zip
more progress on delivery reports. Store the remote results from zot sites locally.
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/zot.php b/include/zot.php
index 767abae38..f728d8fb9 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -957,6 +957,21 @@ function zot_process_response($hub, $arr, $outq) {
logger('zot_process_response: headers: ' . print_r($arr['header'],true), LOGGER_DATA);
}
+ if(array_key_exists('delivery_report',$x)) {
+ foreach($x['delivery_report'] as $xx) {
+ if(is_array($xx) && array_key_exists('message_id',$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'])
+ );
+ }
+ }
+ }
+
// update the timestamp for this site
q("update site set site_dead = 0, site_update = '%s' where site_url = '%s'",