]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Merge pull request #4399 from MrPetovan/task/3878-move-include-bbcode-to-src
[friendica.git] / include / api.php
index a47706013516daaf4013330e73537406bb1c613a..41631567f364bb40bb16a02f64817a6bee5ef918 100644 (file)
@@ -2218,7 +2218,7 @@ function api_statuses_destroy($type)
 
        $ret = api_statuses_show($type);
 
-       Item::delete($id);
+       Item::deleteById($id);
 
        return $ret;
 }
@@ -2459,9 +2459,7 @@ function api_favorites_create_destroy($type)
                        throw new BadRequestException("Invalid action ".$action);
        }
 
-       $r = q("UPDATE item SET starred=%d WHERE id=%d AND uid=%d", $item[0]['starred'], $itemid, api_user());
-
-       q("UPDATE thread SET starred=%d WHERE iid=%d AND uid=%d", $item[0]['starred'], $itemid, api_user());
+       Item::update(['starred' => $item[0]['starred']], ['id' => $itemid]);
 
        if ($r === false) {
                throw new InternalServerErrorException("DB error");
@@ -3991,7 +3989,7 @@ function api_fr_photoalbum_delete($type)
                if (!DBM::is_result($photo_item)) {
                        throw new InternalServerErrorException("problem with deleting items occured");
                }
-               Item::delete($photo_item[0]['id']);
+               Item::deleteById($photo_item[0]['id']);
        }
 
        // now let's delete all photos from the album
@@ -4294,7 +4292,7 @@ function api_fr_photo_delete($type)
                }
                // function for setting the items to "deleted = 1" which ensures that comments, likes etc. are not shown anymore
                // to the user and the contacts of the users (drop_items() do all the necessary magic to avoid orphans in database and federate deletion)
-               Item::delete($photo_item[0]['id']);
+               Item::deleteById($photo_item[0]['id']);
 
                $answer = ['result' => 'deleted', 'message' => 'photo with id `' . $photo_id . '` has been deleted from server.'];
                return api_format_data("photo_delete", $type, ['$result' => $answer]);