summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/html.c b/html.c
index 3286b04..e1df7e9 100644
--- a/html.c
+++ b/html.c
@@ -1886,7 +1886,8 @@ xs_html *html_footer(void)
1886 1886
1887 1887
1888xs_str *html_timeline(snac *user, const xs_list *list, int read_only, 1888xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
1889 int skip, int show, int show_more, char *tag, char *page) 1889 int skip, int show, int show_more,
1890 char *tag, char *page, int utl)
1890/* returns the HTML for the timeline */ 1891/* returns the HTML for the timeline */
1891{ 1892{
1892 xs_list *p = (xs_list *)list; 1893 xs_list *p = (xs_list *)list;
@@ -1938,7 +1939,7 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
1938 xs *msg = NULL; 1939 xs *msg = NULL;
1939 int status; 1940 int status;
1940 1941
1941 if (user && !is_pinned_by_md5(user, v)) 1942 if (utl && user && !is_pinned_by_md5(user, v))
1942 status = timeline_get_by_md5(user, v, &msg); 1943 status = timeline_get_by_md5(user, v, &msg);
1943 else 1944 else
1944 status = object_get_by_md5(v, &msg); 1945 status = object_get_by_md5(v, &msg);
@@ -2412,7 +2413,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2412 2413
2413 if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) { 2414 if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) {
2414 /** empty public timeline for private users **/ 2415 /** empty public timeline for private users **/
2415 *body = html_timeline(&snac, NULL, 1, 0, 0, 0, NULL, ""); 2416 *body = html_timeline(&snac, NULL, 1, 0, 0, 0, NULL, "", 1);
2416 *b_size = strlen(*body); 2417 *b_size = strlen(*body);
2417 status = 200; 2418 status = 200;
2418 } 2419 }
@@ -2430,7 +2431,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2430 xs *pins = pinned_list(&snac); 2431 xs *pins = pinned_list(&snac);
2431 pins = xs_list_cat(pins, list); 2432 pins = xs_list_cat(pins, list);
2432 2433
2433 *body = html_timeline(&snac, pins, 1, skip, show, xs_list_len(next), NULL, ""); 2434 *body = html_timeline(&snac, pins, 1, skip, show, xs_list_len(next), NULL, "", 1);
2434 2435
2435 *b_size = strlen(*body); 2436 *b_size = strlen(*body);
2436 status = 200; 2437 status = 200;
@@ -2467,7 +2468,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2467 xs *pins = pinned_list(&snac); 2468 xs *pins = pinned_list(&snac);
2468 pins = xs_list_cat(pins, list); 2469 pins = xs_list_cat(pins, list);
2469 2470
2470 *body = html_timeline(&snac, pins, 0, skip, show, xs_list_len(next), NULL, "/admin"); 2471 *body = html_timeline(&snac, pins, 0, skip, show,
2472 xs_list_len(next), NULL, "/admin", 1);
2471 2473
2472 *b_size = strlen(*body); 2474 *b_size = strlen(*body);
2473 status = 200; 2475 status = 200;
@@ -2511,7 +2513,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2511 xs *list = timeline_instance_list(skip, show); 2513 xs *list = timeline_instance_list(skip, show);
2512 xs *next = timeline_instance_list(skip + show, 1); 2514 xs *next = timeline_instance_list(skip + show, 1);
2513 2515
2514 *body = html_timeline(&snac, list, 0, skip, show, xs_list_len(next), NULL, "/instance"); 2516 *body = html_timeline(&snac, list, 0, skip, show,
2517 xs_list_len(next), NULL, "/instance", 0);
2515 *b_size = strlen(*body); 2518 *b_size = strlen(*body);
2516 status = 200; 2519 status = 200;
2517 } 2520 }
@@ -2530,7 +2533,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2530 2533
2531 list = xs_list_append(list, md5); 2534 list = xs_list_append(list, md5);
2532 2535
2533 *body = html_timeline(&snac, list, 1, 0, 0, 0, NULL, ""); 2536 *body = html_timeline(&snac, list, 1, 0, 0, 0, NULL, "", 1);
2534 *b_size = strlen(*body); 2537 *b_size = strlen(*body);
2535 status = 200; 2538 status = 200;
2536 } 2539 }