Merge pull request #608 from annando/delete

Changed function that will be private in the future
This commit is contained in:
Hypolite Petovan 2018-05-29 10:00:18 -04:00 committed by GitHub
commit 97108080c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 14 deletions

View File

@ -1042,21 +1042,18 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) {
function pumpio_dodelete(&$a, $uid, $self, $post, $own_id) { function pumpio_dodelete(&$a, $uid, $self, $post, $own_id) {
// Two queries for speed issues // Two queries for speed issues
$r = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", $condition = ['uri' => $post->object->id, 'uid' => $uid];
dbesc($post->object->id), if (dba::exists('item', $condition)) {
intval($uid) Item::delete($condition);
); return true;
}
if (count($r)) $condition = ['extid' => $post->object->id, 'uid' => $uid];
return Item::deleteById($r[0]["id"]); if (dba::exists('item', $condition)) {
Item::delete($condition);
$r = q("SELECT * FROM `item` WHERE `extid` = '%s' AND `uid` = %d LIMIT 1", return true;
dbesc($post->object->id), }
intval($uid) return false;
);
if (count($r))
return Item::deleteById($r[0]["id"]);
} }
function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcompletion = true) { function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcompletion = true) {