diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-28 17:13:11 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-28 17:13:11 -0700 |
commit | e5f47cd14b9dd97385d93c2610e05d959e526ce8 (patch) | |
tree | 9863fff105662540bc6e18b8fac5dbb156e5d0f3 /include/deliver.php | |
parent | dbeae16dc142c3bc832718b0c29eefd6a82033d6 (diff) | |
download | volse-hubzilla-e5f47cd14b9dd97385d93c2610e05d959e526ce8.tar.gz volse-hubzilla-e5f47cd14b9dd97385d93c2610e05d959e526ce8.tar.bz2 volse-hubzilla-e5f47cd14b9dd97385d93c2610e05d959e526ce8.zip |
create site records for all queued sites and check for death
Diffstat (limited to 'include/deliver.php')
-rw-r--r-- | include/deliver.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/deliver.php b/include/deliver.php index 82a1ac6df..62a4ac482 100644 --- a/include/deliver.php +++ b/include/deliver.php @@ -53,16 +53,33 @@ function deliver_run($argv, $argc) { continue; } } + else { + + // zot sites should all have a site record, unless they've been dead for as long as + // your site has existed. Since we don't know for sure what these sites are, + // call them unknown + + q("insert into site (site_url, site_update, site_dead, site_type) values ('%s','%s',0,%d) ", + dbesc($base), + dbesc(datetime_convert()), + intval(($r[0]['outq_driver'] === 'post' ?) SITE_TYPE_NOTZOT : SITE_TYPE_UNKNOWN) + ); + } } } // "post" queue driver - used for diaspora and friendica-over-diaspora communications. if($r[0]['outq_driver'] === 'post') { + + $result = z_post_url($r[0]['outq_posturl'],$r[0]['outq_msg']); if($result['success'] && $result['return_code'] < 300) { logger('deliver: queue post success to ' . $r[0]['outq_posturl'], LOGGER_DEBUG); - + q("update site set site_update = '%s', site_dead = 0 where site_url = '%s' "), + dbesc(datetime_convert()), + dbesc($site_url) + ); q("update dreport set status = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1", dbesc('accepted for delivery'), dbesc(datetime_convert()), |