summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/html.c b/html.c
index 95957a2..3ae9c65 100644
--- a/html.c
+++ b/html.c
@@ -1880,7 +1880,7 @@ xs_html *html_footer(void)
1880 1880
1881 1881
1882xs_str *html_timeline(snac *user, const xs_list *list, int local, 1882xs_str *html_timeline(snac *user, const xs_list *list, int local,
1883 int skip, int show, int show_more, char *tag) 1883 int skip, int show, int show_more, char *tag, char *page)
1884/* returns the HTML for the timeline */ 1884/* returns the HTML for the timeline */
1885{ 1885{
1886 xs_list *p = (xs_list *)list; 1886 xs_list *p = (xs_list *)list;
@@ -2003,12 +2003,15 @@ xs_str *html_timeline(snac *user, const xs_list *list, int local,
2003 xs *m = NULL; 2003 xs *m = NULL;
2004 xs *ss = xs_fmt("skip=%d&show=%d", skip + show, show); 2004 xs *ss = xs_fmt("skip=%d&show=%d", skip + show, show);
2005 2005
2006 xs *url = page == NULL || user == NULL ?
2007 xs_dup(srv_baseurl) : xs_fmt("%s%s", user->actor, page);
2008
2006 if (tag) { 2009 if (tag) {
2007 t = xs_fmt("%s?t=%s", srv_baseurl, tag); 2010 t = xs_fmt("%s?t=%s", url, tag);
2008 m = xs_fmt("%s&%s", t, ss); 2011 m = xs_fmt("%s&%s", t, ss);
2009 } 2012 }
2010 else { 2013 else {
2011 t = xs_fmt("%s%s", user ? user->actor : srv_baseurl, local ? "" : "/admin"); 2014 t = xs_dup(url);
2012 m = xs_fmt("%s?%s", t, ss); 2015 m = xs_fmt("%s?%s", t, ss);
2013 } 2016 }
2014 2017
@@ -2401,7 +2404,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2401 xs *h = xs_str_localtime(0, "%Y-%m.html"); 2404 xs *h = xs_str_localtime(0, "%Y-%m.html");
2402 2405
2403 if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) { 2406 if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) {
2404 *body = html_timeline(&snac, NULL, 1, 0, 0, 0, NULL); 2407 /** empty public timeline for private users **/
2408 *body = html_timeline(&snac, NULL, 1, 0, 0, 0, NULL, "");
2405 *b_size = strlen(*body); 2409 *b_size = strlen(*body);
2406 status = 200; 2410 status = 200;
2407 } 2411 }
@@ -2419,7 +2423,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2419 xs *pins = pinned_list(&snac); 2423 xs *pins = pinned_list(&snac);
2420 pins = xs_list_cat(pins, list); 2424 pins = xs_list_cat(pins, list);
2421 2425
2422 *body = html_timeline(&snac, pins, 1, skip, show, xs_list_len(next), NULL); 2426 *body = html_timeline(&snac, pins, 1, skip, show, xs_list_len(next), NULL, "");
2423 2427
2424 *b_size = strlen(*body); 2428 *b_size = strlen(*body);
2425 status = 200; 2429 status = 200;
@@ -2456,7 +2460,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2456 xs *pins = pinned_list(&snac); 2460 xs *pins = pinned_list(&snac);
2457 pins = xs_list_cat(pins, list); 2461 pins = xs_list_cat(pins, list);
2458 2462
2459 *body = html_timeline(&snac, pins, 0, skip, show, xs_list_len(next), NULL); 2463 *body = html_timeline(&snac, pins, 0, skip, show, xs_list_len(next), NULL, "/admin");
2460 2464
2461 *b_size = strlen(*body); 2465 *b_size = strlen(*body);
2462 status = 200; 2466 status = 200;
@@ -2504,7 +2508,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2504 2508
2505 list = xs_list_append(list, md5); 2509 list = xs_list_append(list, md5);
2506 2510
2507 *body = html_timeline(&snac, list, 1, 0, 0, 0, NULL); 2511 *body = html_timeline(&snac, list, 1, 0, 0, 0, NULL, "");
2508 *b_size = strlen(*body); 2512 *b_size = strlen(*body);
2509 status = 200; 2513 status = 200;
2510 } 2514 }