aboutsummaryrefslogtreecommitdiffstats
path: root/include/connections.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-13 19:58:24 -0700
committerredmatrix <git@macgirvin.com>2016-06-13 19:58:24 -0700
commit1e68d4fb75b9831ed763328b7982e44d1d4cdc5b (patch)
tree5379f5803f4aa3ec8b5bced6b3151cd08cf89d0f /include/connections.php
parent6d4188f05e2a8e92508b1d38e4b7ef5156ba6c42 (diff)
downloadvolse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.tar.gz
volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.tar.bz2
volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.zip
deprecate the item_id table - replace with iconfig. A possibly useful function in the iconfig class would be a search which takes a service id and type and uid, matches against an item and returns the iid. That could save a bit of code duplication.
Diffstat (limited to 'include/connections.php')
-rw-r--r--include/connections.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/connections.php b/include/connections.php
index 2d10b8354..ed4526a09 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -283,18 +283,30 @@ function channel_remove($channel_id, $local = true, $unset_session=false) {
Zotlabs\Daemon\Master::Summon(array('Notifier','purge_all',$channel_id));
}
+
+ $r = q("select * from iconfig left join item on item.id = iconfig.iid
+ where item.uid = %d",
+ intval($channel_id)
+ );
+ if($r) {
+ foreach($r as $rr) {
+ q("delete from iconfig where iid = %d",
+ intval($rr['iid'])
+ );
+ }
+ }
+
+
q("DELETE FROM `groups` WHERE `uid` = %d", intval($channel_id));
q("DELETE FROM `group_member` WHERE `uid` = %d", intval($channel_id));
q("DELETE FROM `event` WHERE `uid` = %d", intval($channel_id));
q("DELETE FROM `item` WHERE `uid` = %d", intval($channel_id));
- q("DELETE FROM `item_id` WHERE `uid` = %d", intval($channel_id));
q("DELETE FROM `mail` WHERE `channel_id` = %d", intval($channel_id));
q("DELETE FROM `notify` WHERE `uid` = %d", intval($channel_id));
q("DELETE FROM `photo` WHERE `uid` = %d", intval($channel_id));
q("DELETE FROM `attach` WHERE `uid` = %d", intval($channel_id));
q("DELETE FROM `profile` WHERE `uid` = %d", intval($channel_id));
q("DELETE FROM `pconfig` WHERE `uid` = %d", intval($channel_id));
- q("DELETE FROM `spam` WHERE `uid` = %d", intval($channel_id));
// @FIXME At this stage we need to remove the file resources located under /store/$nickname