aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-09-23 09:18:02 +0000
committerMario <mario@mariovavti.com>2020-09-23 09:18:02 +0000
commit60fd27eca426aa5001f25f52fc89634ef9c00b9d (patch)
treed1664bafe833eefd292db4e258e05235e671b1a5
parentdfad87f67414c200770e8d279a76d820ffe4a87b (diff)
downloadvolse-hubzilla-60fd27eca426aa5001f25f52fc89634ef9c00b9d.tar.gz
volse-hubzilla-60fd27eca426aa5001f25f52fc89634ef9c00b9d.tar.bz2
volse-hubzilla-60fd27eca426aa5001f25f52fc89634ef9c00b9d.zip
5.0RC testing: on channel removal mark both zot6 and zot xchans and hublocs deleted
-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'])
);
}