From 60fd27eca426aa5001f25f52fc89634ef9c00b9d Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 23 Sep 2020 09:18:02 +0000 Subject: 5.0RC testing: on channel removal mark both zot6 and zot xchans and hublocs deleted --- include/channel.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'include/channel.php') 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']) ); } -- cgit v1.2.3