aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-08-26 08:38:42 +0000
committerMario <mario@mariovavti.com>2021-08-26 08:38:42 +0000
commitd5bf42faf08e8017d7e98c7ee7d23f898e8f9ff4 (patch)
tree80a4768b2aa0cb92cc784fe89c280736302e4155
parent6261d0826c49ca24df9f694931592fbb9bf60f7e (diff)
parent88b13658a7789a60a4228b0b6ae1f5b66fcbeea6 (diff)
downloadvolse-hubzilla-d5bf42faf08e8017d7e98c7ee7d23f898e8f9ff4.tar.gz
volse-hubzilla-d5bf42faf08e8017d7e98c7ee7d23f898e8f9ff4.tar.bz2
volse-hubzilla-d5bf42faf08e8017d7e98c7ee7d23f898e8f9ff4.zip
Merge branch 'dev' into 'dev'
issue 1599 See merge request hubzilla/core!1984
-rw-r--r--Zotlabs/Lib/Libzot.php14
-rw-r--r--include/channel.php6
2 files changed, 13 insertions, 7 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index e0e13eb60..f7d8c417a 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -2584,21 +2584,26 @@ class Libzot {
$desturl = $x['url'];
+ $found_primary = false;
+
$r1 = q("select hubloc_url, hubloc_updated, site_dead from hubloc left join site on
hubloc_url = site_url where hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_primary = 1 limit 1",
dbesc($x['id']),
dbesc($x['id_sig'])
);
+ if ($r1) {
+ $found_primary = true;
+ }
$r2 = q("select xchan_hash from xchan where xchan_guid = '%s' and xchan_guid_sig = '%s' limit 1",
dbesc($x['id']),
dbesc($x['id_sig'])
);
- $site_dead = false;
+ $primary_dead = false;
if ($r1 && intval($r1[0]['site_dead'])) {
- $site_dead = true;
+ $primary_dead = true;
}
// We have valid and somewhat fresh information. Always true if it is our own site.
@@ -2616,13 +2621,14 @@ class Libzot {
// cached entry and the identity is valid. It's just unreachable until they bring back their
// server from the grave or create another clone elsewhere.
- if ($site_dead) {
- logger('dead site - ignoring', LOGGER_DEBUG, LOG_INFO);
+ if ($primary_dead || ! $found_primary) {
+ logger('dead or unknown primary site - ignoring', LOGGER_DEBUG, LOG_INFO);
$r = q("select hubloc_id_url from hubloc left join site on hubloc_url = site_url
where hubloc_hash = '%s' and site_dead = 0",
dbesc($hash)
);
+
if ($r) {
logger('found another site that is not dead: ' . $r[0]['hubloc_url'], LOGGER_DEBUG, LOG_INFO);
$desturl = $r[0]['hubloc_url'];
diff --git a/include/channel.php b/include/channel.php
index ed46904e7..3ee2742b8 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1041,11 +1041,11 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
// @fixme - Not totally certain how to handle $zot_compat for the event timezone which exists
// in Hubzilla but is stored with the item and not the event. In Zap, stored information is
- // always UTC and localised on access as per standard conventions for working with global time data.
+ // always UTC and localised on access as per standard conventions for working with global time data.
// Older Zot (pre-Zot6) records aren't translated correctly w/r/t AS2 so only include events for the last year or so if
- // migrating to Zap.
-
+ // migrating to Zap.
+
$sqle = (($zap_compat) ? " and created > '2020-01-01 00:00:00' " : '');
$r = q("select * from event where uid = %d $sqle",