diff options
author | friendica <info@friendica.com> | 2013-11-05 17:43:32 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-11-05 17:43:32 -0800 |
commit | 5b3adf7755f7bd648c97969ec8b0183797bb2722 (patch) | |
tree | cda1c3c9be872a4c9efd5d85771fb6838720d2b9 | |
parent | f4cb145f3c248aab9188900baebaa5659fa4e343 (diff) | |
download | volse-hubzilla-5b3adf7755f7bd648c97969ec8b0183797bb2722.tar.gz volse-hubzilla-5b3adf7755f7bd648c97969ec8b0183797bb2722.tar.bz2 volse-hubzilla-5b3adf7755f7bd648c97969ec8b0183797bb2722.zip |
more work on channel removal - it might sort of work now but I'm expecting lots of issues. Hence there is still no code in chanman to start the process rolling and make it happen. Will need a barrage of test cases.
-rw-r--r-- | include/Contact.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/include/Contact.php b/include/Contact.php index 46c84aab6..de4ac6ff7 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -216,11 +216,12 @@ function channel_remove($channel_id, $local = true) { // FIXME notify all contacts - $r = q("update channel set channel_pageflags = (channel_pageflags | %d), channel_r_stream = 0, channel_r_profile = 0, + $r = q("update channel set channel_deleted = '%s', channel_pageflags = (channel_pageflags | %d), channel_r_stream = 0, channel_r_profile = 0, channel_r_photos = 0, channel_r_abook = 0, channel_w_stream = 0, channel_w_wall = 0, channel_w_tagwall = 0, channel_w_comment = 0, channel_w_mail = 0, channel_w_photos = 0, channel_w_chat = 0, channel_a_delegate = 0, channel_r_storage = 0, channel_w_storage = 0, channel_r_pages = 0, channel_w_pages = 0, channel_a_republish = 0 where channel_id = %d limit 1", + dbesc(datetime_convert()), intval(PAGE_REMOVED), intval($channel_id) ); @@ -230,6 +231,11 @@ function channel_remove($channel_id, $local = true) { dbesc($channel['channel_hash']) ); + $r = q("update xchan set xchan_flags = xchan_flags | %d where xchan_hash = '%s'", + intval(XCHAN_FLAGS_DELETED), + dbesc($channel['channel_hash']) + ); + proc_run('php','include/notifier.php','purge_all',$channel_id); @@ -248,13 +254,25 @@ function channel_remove($channel_id, $local = true) { q("DELETE FROM `pconfig` WHERE `uid` = %d", intval($channel_id)); q("DELETE FROM `spam` WHERE `uid` = %d", intval($channel_id)); - // We also need a timestamp in the channel DB so we know when to remove the entry. - - $r = q("update channel set channel_pageflags = (channel_pageflags | %d) where channel_id = %d limit 1", + $r = q("update channel set channel_deleted = '%s', channel_pageflags = (channel_pageflags | %d) where channel_id = %d limit 1", + dbesc(datetime_convert()), intval(PAGE_REMOVED), intval($channel_id) ); + $r = q("update hubloc set hubloc_flags = hubloc_flags | %d where hubloc_hash = '%s' and hubloc_url = '%s' ", + intval(HUBLOC_FLAGS_DELETED), + dbesc($channel['channel_hash']), + dbesc(z_root()) + ); + + $r = q("update xchan set xchan_flags = xchan_flags | %d where xchan_hash = '%s' ", + intval(XCHAN_FLAGS_DELETED), + dbesc($channel['channel_hash']) + ); + + + proc_run('php','include/directory.php',$channel_id); if($channel_id == local_user()) { unset($_SESSION['authenticated']); |