diff --git a/boot.php b/boot.php
index 3b7409b1a..3d6f1f3f7 100644
--- a/boot.php
+++ b/boot.php
@@ -16,7 +16,7 @@ require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica Red');
define ( 'FRIENDICA_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1029 );
+define ( 'DB_UPDATE_VERSION', 1030 );
define ( 'EOL', '
' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/include/Contact.php b/include/Contact.php
index 7febe310d..36f4cbcf7 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -153,6 +153,66 @@ function channel_remove($channel_id) {
}
+function remove_all_xchan_resources($xchan, $channel_id = 0) {
+
+ if(intval($channel_id)) {
+
+
+
+ }
+ else {
+
+ // this is somewhat destructive
+// FIXME
+ // We don't want to be quite as destructive on directories, which will need to mirror the action
+ // and we also don't want to completely destroy an xchan that has moved to a new primary location
+
+ $r = q("delete from photo where xchan = '%s'",
+ dbesc($xchan)
+ );
+ $r = q("select resource_id, resource_type, uid, id from item where ( author_xchan = '%s' or owner_xchan = '%s' ) ",
+ dbesc($xchan),
+ dbesc($xchan)
+ );
+ if($r) {
+ foreach($r as $rr) {
+ drop_item($rr,false);
+ }
+ }
+ $r = q("delete from event where event_xchan = '%s'",
+ dbesc($xchan)
+ );
+ $r = q("delete from group_member where xchan = '%s'",
+ dbesc($xchan)
+ );
+ $r = q("delete from mail where ( from_xchan = '%s' or to_xchan = '%s' )",
+ dbesc($xchan),
+ dbesc($xchan)
+ );
+ $r = q("delete from xlink where ( xlink_xchan = '%s' or xlink_link = '%s' )",
+ dbesc($xchan),
+ dbesc($xchan)
+ );
+
+
+ $r = q("delete from xchan where xchan_hash = '%s' limit 1",
+ dbesc($xchan)
+ );
+ $r = q("delete from hubloc where hubloc_hash = '%s'",
+ dbesc($xchan)
+ );
+ $r = q("delete from abook where abook_xchan = '%s'",
+ dbesc($xchan)
+ );
+ $r = q("delete from xtag where xtag_hash = '%s'",
+ dbesc($xchan)
+ );
+
+ }
+}
+
+
+
function contact_remove($channel_id, $abook_id) {
diff --git a/include/gprobe.php b/include/gprobe.php
index 25b56525a..2cc87d149 100644
--- a/include/gprobe.php
+++ b/include/gprobe.php
@@ -20,8 +20,8 @@ function gprobe_run($argv, $argc){
if(! $r) {
$x = zot_finger($url,null);
- if($x) {
- $j = json_decode($x,true);
+ if($x['success']) {
+ $j = json_decode($x['body'],true);
$y = import_xchan($j);
}
}
diff --git a/include/items.php b/include/items.php
index 59bb58eaa..3fd43ca4e 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4265,6 +4265,14 @@ function delete_item_lowlevel($item) {
intval($item['uid'])
);
+ q("delete from term where oid = %d and otype = %d",
+ intval($item['id']),
+ intval(TERM_OBJ_POST)
+ );
+
+// FIXME remove notifications for this item
+
+
return true;
}
diff --git a/install/database.sql b/install/database.sql
index 3deb96c21..7fd200017 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -153,6 +153,7 @@ CREATE TABLE IF NOT EXISTS `channel` (
`channel_prvkey` text NOT NULL,
`channel_notifyflags` int(10) unsigned NOT NULL DEFAULT '65535',
`channel_pageflags` int(10) unsigned NOT NULL DEFAULT '0',
+ `channel_deleted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`channel_max_anon_mail` int(10) unsigned NOT NULL DEFAULT '10',
`channel_max_friend_req` int(10) unsigned NOT NULL DEFAULT '10',
`channel_expire_days` int(11) NOT NULL DEFAULT '0',
@@ -209,7 +210,8 @@ CREATE TABLE IF NOT EXISTS `channel` (
KEY `channel_r_storage` (`channel_r_storage`),
KEY `channel_w_storage` (`channel_w_storage`),
KEY `channel_r_pages` (`channel_r_pages`),
- KEY `channel_w_pages` (`channel_w_pages`)
+ KEY `channel_w_pages` (`channel_w_pages`),
+ KEY `channel_deleted` (`channel_deleted`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `clients` (
diff --git a/install/update.php b/install/update.php
index 7c755dd2d..290b80cd1 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
$title
+
+