From: Michael Date: Tue, 29 May 2018 05:24:25 +0000 (+0000) Subject: Changed function that will be private in the future X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5c668bd6e9f22b657ca31245da3bf8df7a0cffb0;p=friendica-addons.git Changed function that will be private in the future --- diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 8426c535..b45e7670 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -1042,21 +1042,15 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) { function pumpio_dodelete(&$a, $uid, $self, $post, $own_id) { // Two queries for speed issues - $r = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", - dbesc($post->object->id), - intval($uid) - ); - - if (count($r)) - return Item::deleteById($r[0]["id"]); - - $r = q("SELECT * FROM `item` WHERE `extid` = '%s' AND `uid` = %d LIMIT 1", - dbesc($post->object->id), - intval($uid) - ); + $condition = ['uri' => $post->object->id, 'uid' => $uid]; + if (dba::exists('item', $condition)) { + return Item::delete($condition); + } - if (count($r)) - return Item::deleteById($r[0]["id"]); + $condition = ['extid' => $post->object->id, 'uid' => $uid]; + if (dba::exists('item', $condition)) { + return Item::delete($condition); + } } function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcompletion = true) {