]> git.mxchange.org Git - friendica.git/blobdiff - mod/starred.php
Just one more ...
[friendica.git] / mod / starred.php
index 364d5c59571285ea760824deb1d5b2ff09b7fb6a..ce0c8fc09c658652234aac744d325cfe1edb6d3b 100644 (file)
@@ -8,10 +8,8 @@ use Friendica\Database\DBM;
 use Friendica\Model\Item;
 
 function starred_init(App $a) {
-
-       require_once("include/threads.php");
-
        $starred = 0;
+       $message_id = null;
 
        if (! local_user()) {
                killme();
@@ -35,13 +33,7 @@ function starred_init(App $a) {
                $starred = 1;
        }
 
-       $r = q("UPDATE `item` SET `starred` = %d WHERE `uid` = %d AND `id` = %d",
-               intval($starred),
-               intval(local_user()),
-               intval($message_id)
-       );
-
-       Item::updateThread($message_id);
+       Item::update(['starred' => $starred], ['id' => $message_id]);
 
        // See if we've been passed a return path to redirect to
        $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');