aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-28 21:42:46 -0700
committerfriendica <info@friendica.com>2014-05-28 21:42:46 -0700
commit2a6d7b6a079a565afc0200fe160cb2402ed7c0a3 (patch)
tree5e7c28189a8f7db259bdab7b1d96f2ab3b574686 /include/zot.php
parent53ea6b05a644c75810a95e351021251f0f759e9f (diff)
downloadvolse-hubzilla-2a6d7b6a079a565afc0200fe160cb2402ed7c0a3.tar.gz
volse-hubzilla-2a6d7b6a079a565afc0200fe160cb2402ed7c0a3.tar.bz2
volse-hubzilla-2a6d7b6a079a565afc0200fe160cb2402ed7c0a3.zip
cleanup dead directory entries. This was a real b#tch, so keep your eye out for issues - which you shouldn't see until next weekend when this is scheduled to run. We're only setting flags, so if anything goes wrong we should be able to recover without too much pain.
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/zot.php b/include/zot.php
index 869943a24..303f4f4a7 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -840,6 +840,24 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED) {
intval($r[0]['hubloc_id'])
);
}
+ if($r[0]['hubloc_status'] & HUBLOC_OFFLINE) {
+ q("update hubloc set hubloc_status = (hubloc_status ^ %d) where hubloc_id = %d limit 1",
+ intval(HUBLOC_OFFLINE),
+ intval($r[0]['hubloc_id'])
+ );
+ if($r[0]['hubloc_flags'] & HUBLOC_FLAGS_ORPHANCHECK) {
+ q("update hubloc set hubloc_flags = (hubloc_flags ^ %d) where hubloc_id = %d limit 1",
+ intval(HUBLOC_FLAGS_ORPHANCHECK),
+ intval($r[0]['hubloc_id'])
+ );
+ }
+ q("update xchan set xchan_flags = (xchan_flags ^ %d) where (xchan_flags & %d) and xchan_hash = '%s' limit 1",
+ intval(XCHAN_FLAGS_ORPHAN),
+ intval(XCHAN_FLAGS_ORPHAN),
+ dbesc($xchan_hash)
+ );
+
+ }
// Remove pure duplicates
if(count($r) > 1) {