projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rework /feedinfo logic
[blerg.git]
/
cgi
/
cgi_blerg.c
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);