From 3ffead15ab676ff4608888ba0646b64af6cfe86b Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Mon, 4 Apr 2022 02:20:48 +0000 Subject: [PATCH] I am stupid FossilOrigin-Name: 6eb45682ec5d4f6a7a1f2d6b6f3b07e898f50523c0a1d3c78da69669eeb48a48 --- src/cookie.c | 3 ++- src/cookie.h | 1 + src/main.c | 4 ++-- src/query.c | 3 +-- src/query.h | 2 -- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/cookie.c b/src/cookie.c index 7ba6dce..c1e02c6 100644 --- a/src/cookie.c +++ b/src/cookie.c @@ -52,7 +52,8 @@ char* read_cookies_env(struct cookie_values* cookies) struct key_value_refs refs[] = { { "access_token", &(cookies->access_token) }, { "logged_in", &(cookies->logged_in) }, - { "theme", &(cookies->theme) } + { "theme", &(cookies->theme) }, + { "instance_url", &(cookies->instance_url) } }; do diff --git a/src/cookie.h b/src/cookie.h index 5fb39f3..cb24184 100644 --- a/src/cookie.h +++ b/src/cookie.h @@ -25,6 +25,7 @@ struct cookie_values char* access_token; char* logged_in; char* theme; + char* instance_url; }; struct http_cookie_info diff --git a/src/main.c b/src/main.c index 74f2fff..f2ec039 100644 --- a/src/main.c +++ b/src/main.c @@ -66,8 +66,8 @@ int main(void) char* get_str = read_query_data(&(ssn.query)); mastodont_t api; - if (ssn.post.instance_url) - api.url = ssn.post.instance_url; + if (ssn.cookies.instance_url) + api.url = ssn.cookies.instance_url; else api.url = config_instance_url; mastodont_init(&api, MSTDNT_FLAG_NO_URI_SANITIZE | config_library_flags); diff --git a/src/query.c b/src/query.c index c2899d9..ccb0af3 100644 --- a/src/query.c +++ b/src/query.c @@ -86,8 +86,7 @@ char* read_post_data(struct query_values* post) { "replyid", &(post->replyid) }, { "min_id", &(post->min_id) }, { "max_id", &(post->max_id) }, - { "start_id", &(post->start_id) }, - { "instance_url", &(post->instance_url) }, + { "start_id", &(post->start_id) } }; // END Query references diff --git a/src/query.h b/src/query.h index 9be60c9..39f8b87 100644 --- a/src/query.h +++ b/src/query.h @@ -45,8 +45,6 @@ struct query_values char* min_id; char* max_id; char* start_id; - - char* instance_url; }; struct get_values