aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-10-27 05:26:34 -0700
committerfriendica <info@friendica.com>2012-10-27 05:26:34 -0700
commit1a9ab127482ee4eb17e3d2bd0ffa222f7053715b (patch)
tree780f6659e29d4a9051cb82e62dfddacd6821a782 /mod
parent96c8e74438d4f7c324c96893720fd4018925de4f (diff)
downloadvolse-hubzilla-1a9ab127482ee4eb17e3d2bd0ffa222f7053715b.tar.gz
volse-hubzilla-1a9ab127482ee4eb17e3d2bd0ffa222f7053715b.tar.bz2
volse-hubzilla-1a9ab127482ee4eb17e3d2bd0ffa222f7053715b.zip
fix starring posts
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();
}