delete from the wp side as well as from the red side

This commit is contained in:
friendica
2013-11-26 17:02:49 -08:00
parent 6f6fcddfc3
commit ef53c72a70
2 changed files with 66 additions and 26 deletions

View File

@@ -1080,19 +1080,35 @@ require_once('include/photos.php');
// params
$id = intval(argv(3));
if($id) {
// first prove that we own the item
// first prove that we own the item
$r = q("select * from item where id = %d and uid = %d limit 1",
intval($id),
intval($user_info['uid'])
);
if($r) {
logger('API: api_statuses_destroy: '.$id);
require_once('include/items.php');
drop_item($id, false);
$r = q("select * from item where id = %d and uid = %d limit 1",
intval($id),
intval($user_info['uid'])
);
if(! $r)
return false;
}
else {
if($_REQUEST['namespace'] && $_REQUEST['remote_id']) {
$r = q("select * from item_id where service = '%s' and sid = '%s' and uid = %d limit 1",
dbesc($_REQUEST['namespace']),
dbesc($_REQUEST['remote_id']),
intval($user_info['uid'])
);
if(! $r)
return false;
$id = $r[0]['iid'];
}
}
if(! $id)
return false;
logger('API: api_statuses_destroy: '.$id);
require_once('include/items.php');
drop_item($id, false);
if ($type == 'xml')
$ok = "true";
@@ -1114,7 +1130,7 @@ require_once('include/photos.php');
if (api_user()===false) return false;
$user_info = api_get_user($a);
// get last newtork messages
// get last network messages
// params