projects
/
blerg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a3b400b
)
Rework /feedinfo logic
author
Chip Black
<bytex64@bytex64.net>
Mon, 18 Jul 2011 08:57:52 +0000
(
03:57
-0500)
committer
Chip Black
<bytex64@bytex64.net>
Mon, 18 Jul 2011 08:57:52 +0000
(
03:57
-0500)
cgi/cgi_blerg.c
patch
|
blob
|
history
diff --git
a/cgi/cgi_blerg.c
b/cgi/cgi_blerg.c
index
85af748
..
cfe8031
100644
(file)
--- a/
cgi/cgi_blerg.c
+++ b/
cgi/cgi_blerg.c
@@
-383,8
+383,7
@@
int main(int argc, char *argv[]) {
yajl_gen g = yajl_gen_alloc(&yajl_c, NULL);
yajl_gen_map_open(g);
yajl_gen g = yajl_gen_alloc(&yajl_c, NULL);
yajl_gen_map_open(g);
- ret = parse_url_info(path + 10, &info);
- if ((ret & URL_INFO_NAME) == 0) {
+ if (path[9] == 0) {
struct blerg *b = blerg_open(username);
uint64_t subscription_mark = blerg_get_subscription_mark(b);
blerg_close(b);
struct blerg *b = blerg_open(username);
uint64_t subscription_mark = blerg_get_subscription_mark(b);
blerg_close(b);
@@
-393,8
+392,12
@@
int main(int argc, char *argv[]) {
yajl_gen_integer(g, subscription_count_items(username) - subscription_mark);
} else {
yajl_gen_string(g, "subscribed", 10);
yajl_gen_integer(g, subscription_count_items(username) - subscription_mark);
} else {
yajl_gen_string(g, "subscribed", 10);
- yajl_gen_bool(g, is_subscribed(username, info.name));
-
+ ret = parse_url_info(path + 10, &info);
+ if ((ret & URL_INFO_NAME) == 1) {
+ yajl_gen_bool(g, is_subscribed(username, info.name));
+ } else {
+ yajl_gen_bool(g, 0);
+ }
}
yajl_gen_map_close(g);
}
yajl_gen_map_close(g);