aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-09-23 09:18:02 +0000
committerMario <mario@mariovavti.com>2020-09-23 11:19:17 +0200
commitbe43d3e0fd0f9b51bedc3f84190864f71ab7d5d3 (patch)
tree843f954ef459f42e09b2e24a05c1d9f1cc4cae00
parentca4a3c3cc0f5aff6b26e9e4583c7a3dd9c0db111 (diff)
downloadvolse-hubzilla-be43d3e0fd0f9b51bedc3f84190864f71ab7d5d3.tar.gz
volse-hubzilla-be43d3e0fd0f9b51bedc3f84190864f71ab7d5d3.tar.bz2
volse-hubzilla-be43d3e0fd0f9b51bedc3f84190864f71ab7d5d3.zip
5.0RC testing: on channel removal mark both zot6 and zot xchans and hublocs deleted
(cherry picked from commit 60fd27eca426aa5001f25f52fc89634ef9c00b9d)
-rw-r--r--include/channel.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/channel.php b/include/channel.php
index 45000cdff..9424c8550 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -2812,12 +2812,15 @@ function channel_remove($channel_id, $local = true, $unset_session = false) {
logger('deleting hublocs',LOGGER_DEBUG);
- $r = q("update hubloc set hubloc_deleted = 1 where hubloc_hash = '%s'",
- dbesc($channel['channel_hash'])
+ $r = q("UPDATE hubloc SET hubloc_deleted = 1 WHERE hubloc_hash = '%s' OR hubloc_hash = '%s'",
+ dbesc($channel['channel_hash']),
+ dbesc($channel['channel_portable_id'])
+
);
- $r = q("update xchan set xchan_deleted = 1 where xchan_hash = '%s'",
- dbesc($channel['channel_hash'])
+ $r = q("UPDATE xchan SET xchan_deleted = 1 WHERE xchan_hash = '%s' OR xchan_hash = '%s'",
+ dbesc($channel['channel_hash']),
+ dbesc($channel['channel_portable_id'])
);
Master::Summon(array('Notifier','purge_all',$channel_id));
@@ -2901,8 +2904,9 @@ function channel_remove($channel_id, $local = true, $unset_session = false) {
logger('deleting hublocs',LOGGER_DEBUG);
- $r = q("update hubloc set hubloc_deleted = 1 where hubloc_hash = '%s' and hubloc_url = '%s' ",
+ $r = q("UPDATE hubloc SET hubloc_deleted = 1 WHERE (hubloc_hash = '%s' OR hubloc_hash = '%s') AND hubloc_url = '%s' ",
dbesc($channel['channel_hash']),
+ dbesc($channel['channel_portable_id']),
dbesc(z_root())
);
@@ -2917,8 +2921,9 @@ function channel_remove($channel_id, $local = true, $unset_session = false) {
$hublocs = count($r);
if(! $hublocs) {
- $r = q("update xchan set xchan_deleted = 1 where xchan_hash = '%s' ",
- dbesc($channel['channel_hash'])
+ $r = q("UPDATE xchan SET xchan_deleted = 1 WHERE xchan_hash = '%s' OR xchan_hash = '%s'",
+ dbesc($channel['channel_hash']),
+ dbesc($channel['channel_portable_id'])
);
}