From 853744e1b025a71dea8fa1e1c925416c5e5a0f76 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Tue, 19 Apr 2022 17:09:51 +0000 Subject: [PATCH] Show correct category FossilOrigin-Name: 579e6afea17ae7cbe5cd22097ae7c1e84a0cf9841bf8eafce0e9316cfdb35e7a --- src/index.c | 2 +- src/timeline.c | 9 ++++----- src/timeline.h | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/index.c b/src/index.c index 02a96e9..21f2bb7 100644 --- a/src/index.c +++ b/src/index.c @@ -22,5 +22,5 @@ void content_index(struct session* ssn, mastodont_t* api) { // Check logins - tl_public(ssn, api, 0); + tl_public(ssn, api, 0, BASE_CAT_HOME); } diff --git a/src/timeline.c b/src/timeline.c index 35cfb02..36d2374 100644 --- a/src/timeline.c +++ b/src/timeline.c @@ -31,7 +31,7 @@ #include "../static/navigation.chtml" -void tl_public(struct session* ssn, mastodont_t* api, int local) +void tl_public(struct session* ssn, mastodont_t* api, int local, enum base_category cat) { size_t status_count = 0, statuses_html_count = 0; struct mstdnt_status* statuses = NULL; @@ -82,7 +82,7 @@ void tl_public(struct session* ssn, mastodont_t* api, int local) STR_NULL_EMPTY(navigation_box)); struct base_page b = { - .category = BASE_CAT_HOME, + .category = cat, .locale = L10N_EN_US, .content = output, .sidebar_left = NULL @@ -152,17 +152,16 @@ void tl_list(struct session* ssn, mastodont_t* api, char* list_id) if (output) free(output); } - void content_tl_federated(struct session* ssn, mastodont_t* api, char** data) { (void)data; - tl_public(ssn, api, 0); + tl_public(ssn, api, 0, BASE_CAT_FEDERATED); } void content_tl_local(struct session* ssn, mastodont_t* api, char** data) { (void)data; - tl_public(ssn, api, 1); + tl_public(ssn, api, 1, BASE_CAT_LOCAL); } void content_tl_list(struct session* ssn, mastodont_t* api, char** data) diff --git a/src/timeline.h b/src/timeline.h index 1eff0f1..2d58589 100644 --- a/src/timeline.h +++ b/src/timeline.h @@ -21,9 +21,10 @@ #include #include #include "session.h" +#include "base_page.h" // Federated and local are here -void tl_public(struct session* ssn, mastodont_t* api, int local); +void tl_public(struct session* ssn, mastodont_t* api, int local, enum base_category cat); void tl_list(struct session* ssn, mastodont_t* api, char* list_id); void content_tl_federated(struct session* ssn, mastodont_t* api, char** data);