From 2552e13068f03265a15fa7474552523170679994 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Mon, 4 Apr 2022 02:10:18 +0000 Subject: [PATCH] Login to different instance Still needs config variable and frontend option FossilOrigin-Name: f4d86db71043191548edc8b23c496eaa1f5a44f464a033f2d722439c0807f3f1 --- src/main.c | 5 ++++- src/query.c | 2 +- src/query.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 9e5fd7a..74f2fff 100644 --- a/src/main.c +++ b/src/main.c @@ -66,7 +66,10 @@ int main(void) char* get_str = read_query_data(&(ssn.query)); mastodont_t api; - api.url = config_instance_url; + if (ssn.post.instance_url) + api.url = ssn.post.instance_url; + else + api.url = config_instance_url; mastodont_init(&api, MSTDNT_FLAG_NO_URI_SANITIZE | config_library_flags); api.token = ssn.cookies.access_token; // Load token now diff --git a/src/query.c b/src/query.c index 12a9a17..3aae953 100644 --- a/src/query.c +++ b/src/query.c @@ -87,7 +87,7 @@ char* read_post_data(struct query_values* post) { "min_id", &(post->min_id) }, { "max_id", &(post->max_id) }, { "start_id", &(post->start_id) }, - + { "instance_url", &(post->start_id) }, }; // END Query references diff --git a/src/query.h b/src/query.h index 39f8b87..9be60c9 100644 --- a/src/query.h +++ b/src/query.h @@ -45,6 +45,8 @@ struct query_values char* min_id; char* max_id; char* start_id; + + char* instance_url; }; struct get_values