aboutsummaryrefslogtreecommitdiffstats
path: root/include/Contact.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2013-11-12 02:09:32 -0800
committerPaolo T <tuscanhobbit@users.noreply.github.com>2013-11-12 02:09:32 -0800
commit67a101452b82782114143dc0b5bdba15adc0ba99 (patch)
tree9daee3807b370d02ee4c28e6df7db08731fbb9f1 /include/Contact.php
parentb23f3fc03b6bc751aab67fe2258a21f7c65bab8e (diff)
parent7cb4c2f8ad813336aafdec05e40f3a8eb1808d00 (diff)
downloadvolse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.tar.gz
volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.tar.bz2
volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.zip
Merge pull request #4 from friendica/master
Fork aligned to red master
Diffstat (limited to 'include/Contact.php')
-rw-r--r--include/Contact.php26
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']);