aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-04 19:09:53 -0700
committerfriendica <info@friendica.com>2013-08-04 19:09:53 -0700
commitad36ccdbc802bbf4d8bcce8754ae3a1ca63bcbfc (patch)
tree367b489b582a4c512194733f83f642b801004f54 /include
parent159a347c01c00c260a09b11fed76c02177ebe811 (diff)
downloadvolse-hubzilla-ad36ccdbc802bbf4d8bcce8754ae3a1ca63bcbfc.tar.gz
volse-hubzilla-ad36ccdbc802bbf4d8bcce8754ae3a1ca63bcbfc.tar.bz2
volse-hubzilla-ad36ccdbc802bbf4d8bcce8754ae3a1ca63bcbfc.zip
progress on unfriending
Diffstat (limited to 'include')
-rw-r--r--include/Contact.php34
1 files changed, 19 insertions, 15 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 109c345c1..7e6c65ac1 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -263,8 +263,6 @@ function remove_all_xchan_resources($xchan, $channel_id = 0) {
}
-
-
function contact_remove($channel_id, $abook_id) {
if((! $channel_id) || (! $abook_id))
@@ -293,31 +291,37 @@ function contact_remove($channel_id, $abook_id) {
if($abook['abook_flags'] & ABOOK_FLAG_SELF)
return false;
- q("delete from item where author_xchan = '%s' and uid = %d",
+
+ $r = q("select * from item where author_xchan = '%s' and uid = %d",
dbesc($abook['abook_xchan']),
intval($channel_id)
);
+ if($r) {
+ foreach($r as $rr) {
+ drop_item($rr,false);
+ }
+ }
q("delete from abook where abook_id = %d and abook_channel = %d limit 1",
intval($abook['abook_id']),
intval($channel_id)
);
-/*
-// FIXME
- q("DELETE FROM `photo` WHERE `contact-id` = %d ",
- intval($id)
- );
- q("DELETE FROM `mail` WHERE `contact-id` = %d ",
- intval($id)
+ $r = q("delete from event where event_xchan = '%s' and uid = %d",
+ dbesc($abook['abook_xchan']),
+ intval($channel_id)
);
- q("DELETE FROM `event` WHERE `cid` = %d ",
- intval($id)
+
+ $r = q("delete from group_member where xchan = '%s' and uid = %d",
+ dbesc($abook['abook_xchan']),
+ intval($channel_id)
);
- q("DELETE FROM `queue` WHERE `cid` = %d ",
- intval($id)
+
+ $r = q("delete from mail where ( from_xchan = '%s' or to_xchan = '%s' ) and uid = %d ",
+ dbesc($abook['abook_xchan']),
+ dbesc($abook['abook_xchan']),
+ intval($channel_id)
);
-*/
return true;
}