aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/starred.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/mod/starred.php b/mod/starred.php
index af11acfb5..530c5c7e0 100644
--- a/mod/starred.php
+++ b/mod/starred.php
@@ -7,8 +7,8 @@ function starred_init(&$a) {
if(! local_user())
killme();
- if($a->argc > 1)
- $message_id = intval($a->argv[1]);
+ if(argc() > 1)
+ $message_id = intval(argv(1));
if(! $message_id)
killme();
@@ -24,7 +24,7 @@ function starred_init(&$a) {
if($item_flags & ITEM_STARRED)
$item_flags -= ITEM_STARRED;
else
- $item_flags = $item_flags | ITEM_STARRED;
+ $item_flags += ITEM_STARRED;
$r = q("UPDATE item SET item_flags = %d WHERE uid = %d and id = %d LIMIT 1",
@@ -32,8 +32,8 @@ function starred_init(&$a) {
intval(local_user()),
intval($message_id)
);
-
+
header('Content-type: application/json');
- echo json_encode(array('result' => intval($item_flags & ITEM_STARRED)));
+ echo json_encode(array('result' => (($item_flags & ITEM_STARRED) ? 1 : 0)));
killme();
}